• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Struts2 newbee - Problem when using form tag

 
Ranch Hand
Posts: 208
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
i just want to perform user login using a form tag but i am having a small problem.

index.jsp



Action Class : User.java



The Result page after loggin in : osrwelcome.jsp





struts.xml



web.xml



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>
12: LOGIN BELOW
13:

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/>


Stacktrace:
org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:524)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:435)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:320)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:266)
javax.servlet.http.HttpServlet.service(HttpServlet.java:803)


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
 
Author
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You can either redirect to an action, or configure the container to allow using an action as a welcome page.
 
Think of how dumb the average person is. Mathematically, half of them are EVEN DUMBER. Smart tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic