문제

I have a form I want the form(localhost/myapp) which has 3 pages.

1.Input taken From user(asd.jsp)

2.Validation(with the help of DB)(dfg.jsp)

3.To enter Details required for my app.(zxc.jsp)

Now in the url at any given time I want onlylocalhost/myapp/ and I don't want to my jsp filenames on the url..

P.S: Already tried

<servlet>
<servlet-name>myapp</servlet-name>
<jsp-file>/dfg.jsp</jsp-file>
</servlet>
<servlet-mapping>
<servlet-name>myapp</servlet-name>
<url-pattern>/myapp</url-pattern> 
</servlet-mapping>

its workin but I can still access by the file by Typing the url url..I don't want anyone to do that....So require Guidance!!!

Thanks in Adv!!!

올바른 솔루션이 없습니다

다른 팁

Put the jsp under WEB-INF. Then it will not be accessible by filename in the url. You obviously will have to change your web.xml accordingly:

<servlet>
<servlet-name>myapp</servlet-name>
<jsp-file>/WEB-INF/dfg.jsp</jsp-file>
</servlet>
<servlet-mapping>
<servlet-name>myapp</servlet-name>
<url-pattern>/myapp</url-pattern> 
</servlet-mapping>
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top