• Post Reply Bookmark Topic Watch Topic
  • New Topic

How to map jstl action form with java servlet by anotation @WebServlet?

 
derek nguyen
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have a very simple login form. However, I keep getting http: status 404 -/login

login.jsp




LoginServlet.java


 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 65516
105
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Likely, the form URL needs to be prefixed by the context path.
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 65516
105
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
P.S. Terminology: this is just a form, not a "JSTL action form". Not sure what you meant to imply by that.
 
derek nguyen
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Would you mind to give me some more detail instruction please? I am still learning web development, so there are a lot of definitions I have gotten used yet.
 
derek nguyen
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yeah, I just a regular html form. But I intend to develop more by using JSTL taglibs such as display the username. But I got stuck with the that form right now, so I can not go further
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 65516
105
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
See the JspFaq for more information.

The context path is the mapping for your web application within Tomcat (or whatever container you are using).

Specifically, you can get the context path with: ${pageContext.request.contextPath}
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!