aspose file tools*
The moose likes Servlets and the fly likes How to Configuring Servlet Mappings? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Bookmark "How to Configuring Servlet Mappings?" Watch "How to Configuring Servlet Mappings?" New topic
Author

How to Configuring Servlet Mappings?

Leonardo Carreira
Ranch Hand

Joined: Apr 07, 2009
Posts: 489

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


Sorry, perhaps my english language isn't too good.. Prepare for SCJP 6, Please God help me.. ☼
References : [Java.Boot] [JavaChamp] [JavaPrepare]
Seetharaman Venkatasamy
Ranch Hand

Joined: Jan 28, 2008
Posts: 5575

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

Joined: Apr 07, 2009
Posts: 489

@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

Joined: Jan 28, 2008
Posts: 5575

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

Joined: Apr 07, 2009
Posts: 489

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

Joined: Jan 28, 2008
Posts: 5575

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
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: How to Configuring Servlet Mappings?