Now only URIs that end with “*.html” will go through the struts’ servlet filter. Now assume your index file is a jsp called, well index.jsp. So your welcome file list should be something like this.
This configuration works as long as you don't have any struts tags in the index.jsp file. But whenever you put struts tags, the index.jsp file must be accessed by going through the struts servlet filter. Otherwise, following error will pop out.
org.apache.jasper.JasperException: The Struts dispatcher cannot be found. This is usually caused by using Struts tags without the associated filter.
So we need to do following changes to make our welcome files go through struts.
- Change the welcome files list to the following
<welcome-file>index.html</welcome-file>
- Create an empty file called html in the web root
- Specify an action for index.jsp in the struts.xml file
No comments:
Post a Comment