質問

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