This week's book giveaway is in the JavaScript forum.
We're giving away four copies of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js and have Paul Jensen on-line!
See this thread for details.
Win a copy of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js this week in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

web.xml entry for jsp hiding  RSS feed

 
Raj Puri
Ranch Hand
Posts: 189
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Here is my web.xml entry. I was hoping to place my jsp file test.jsp under
WEB-INF and call it simply by http://myapp/test. That does not seem to work.

I am sure I have some mistake in this web.xml entry. Any ideas?

----->
<servlet>
<servlet-name>test</servlet-name>
<jsp-file>/WEB-INF/test.jsp</jsp-file>
</servlet>
<servlet-name>test</servlet-name>
<url-pattern>/test</url-pattern>
 
Nikhil Menon
Ranch Hand
Posts: 70
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You gave
<servlet>
<servlet-name>test</servlet-name>
<jsp-file>/WEB-INF/test.jsp</jsp-file>
</servlet>
<servlet-name>test</servlet-name>
<url-pattern>/test</url-pattern>


I guess you have the <servlet-mapping> element in your web.xml.
Because it was not shown by you here.

Send whether you are getting any error messages om tomcat console.
 
Raj Puri
Ranch Hand
Posts: 189
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
No I do not have servlet mappin tag. I really do not have servlet here I am just trying to assign a psudeo name for jsp file. I picked up this from a book and seems to not work. There is no error message in error log also.
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser Redhat VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes, I've tried this before and it doesn't work.
You would think that it would. It's not redirecting, so I was expecting that it would behave like a forward.
 
Dan Novik
Ranch Hand
Posts: 39
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
There is a file access filter in JSOS:
http://www.servletsuite.com/servlets/fileaccessflt.htm

It closes the direct access to JSP files
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!