Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How to Configuring Servlet Mappings?

 
Leonardo Carreira
Ranch Hand
Posts: 494
Eclipse IDE Java Postgres Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Friends...

iam wondering for servlet...
i found a problem when i developed servlet and mapped it..
i made a simple servlet + JSP application..
at JSP, when i posted to servlet mapping /Servlet1... it could ran well..
but when i posted to servlet mapping /Servlets/Servlet3.. i couldn't ran well..

here is my Servlet mapping..


And here is my JSP :


Sorry for the basic question..

Thanks in advance..
 
Seetharaman Venkatasamy
Ranch Hand
Posts: 5575
Eclipse IDE Java Windows XP
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Leonardo Carreira wrote: it couldn't ran well..


what happen to that ! what is the problem exactly?.post your error message. it help us to find out the problem
 
Leonardo Carreira
Ranch Hand
Posts: 494
Eclipse IDE Java Postgres Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
@seetharaman

Thanks for your reply sir..
yap, i got error HTTP 404 Not Found when i clicked a button at the JSP..
is My Servlet Mapping configuration true or not?..

yap, at JSP, the main problem is i want to execute servlet (Servlet3). And i written JSP code like this (but these couldn't ran well)..


but when i executed another servlet (Servlet1), with JSP code like this : (these could ran well)..


Thanks in advance..
 
Seetharaman Venkatasamy
Ranch Hand
Posts: 5575
Eclipse IDE Java Windows XP
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
try below one


scriptlet is discourage in jsp. if you know EL then use else try to know about it

using EL

 
Leonardo Carreira
Ranch Hand
Posts: 494
Eclipse IDE Java Postgres Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks sir..

it could ran well now..
i use EL.. by the way, what is the mean of EL?..

with <%=request.getContextPath()%> it still could'nt ran..
which one is good for implementation (general implemenattion)? request.getContextPath() or EL?..

Thanks in advance..
 
Seetharaman Venkatasamy
Ranch Hand
Posts: 5575
Eclipse IDE Java Windows XP
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Leonardo Carreira wrote:Thanks sir..


You are welcome.
to know about EL, Google "EL in jsp" . and directly putting the java code in jsp (using scriptlet) is bad practice ,difficult to maintain in future . so we recommend EL
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic