my dog learned polymorphism
The moose likes Struts and the fly likes Struts2 newbee - Problem when using form tag Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Struts2 newbee - Problem when using form tag" Watch "Struts2 newbee - Problem when using form tag" New topic

Struts2 newbee - Problem when using form tag

shukla raghav
Ranch Hand

Joined: Aug 03, 2008
Posts: 203
i just want to perform user login using a form tag but i am having a small problem.


Action Class :

The Result page after loggin in : osrwelcome.jsp



when i run this application i get following error

org.apache.jasper.JasperException: An exception occurred processing JSP page /index.jsp at line 14

11: <h2>OSR Knowledge Probe I</h2>

14: <s:form action="User_Login.action" >
15: <s:textfield name="userName" label="User Name"/>
16: <s:password name="password" label="Password"/>
17: <s:submit/>


root cause

The Struts dispatcher cannot be found. This is usually caused by using Struts tags without the associated filter. Struts tags are only usable when the request has passed through its servlet filter, which initializes the Struts dispatcher needed for this tag. - [unknown location]

what i am feeling is that because my index.jsp is my welcome file as mentioned in the web.xml and it is directly served by the server without going through the filter dispatcher therefore the filter dispatcher is unable to run the neccessary interceptors in order to use the tags on the index file.

Then how can we have an index file that uses struts2 UI tags, because the index file will always pass through without the Filterdispatcher ??? It means that can we never use UI tags on the index page
David Newton

Joined: Sep 29, 2008
Posts: 12617

You can either redirect to an action, or configure the container to allow using an action as a welcome page.
I agree. Here's the link:
subject: Struts2 newbee - Problem when using form tag
It's not a secret anymore!