File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Servlets and the fly likes map servlet with index.jsp Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "map servlet with index.jsp " Watch "map servlet with index.jsp " New topic
Author

map servlet with index.jsp

fabian verbeek
Ranch Hand

Joined: Oct 20, 2012
Posts: 52
Hi,

I'm new in java and i need help. I have a page index.jsp that is in my welcome-file
I need to map this page with a servlet so i tried this but when i run it, i have a blank page.

here is my web.xml


and here my servlet


in my index.jsp that is under WebContent directory i have this:

<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
<head></head>
<body>
<cut value="${message}" default="message param"></cut>
</body>
</html>

thanks for your help
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60774
    
  65

Why are you trying to map index.jsp to a servlet? If you want the servlet as the "welcome file" just declare it as so. No need to stand on your head with weird mappings.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
fabian verbeek
Ranch Hand

Joined: Oct 20, 2012
Posts: 52
How can i do that?
Do you have a sample?

thanks for your reply as i sayied i'm new in java :-)
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60774
    
  65

Search for the term welcome-file-list in this forum, and on the Internet and you should find many examples.
fabian verbeek
Ranch Hand

Joined: Oct 20, 2012
Posts: 52
thanks for your reply, i simply add my servlet in my welcome-list-files
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60774
    
  65

 
wood burning stoves
 
subject: map servlet with index.jsp
 
Similar Threads
data from servlet to jsp
Exceptional Handling in Struts
Does Spring framework supported by godaddy shared linux hosting
forEach giving error
can't print after post doFilter