954,574 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

where to write JSP file in tomcat5.5 folder

Hi all,

I want to run jsp programs, where should i place the folder in tomcat5.5 and how to run it.
please help me out.

Thanks

ishlux
Junior Poster
145 posts since Jun 2008
Reputation Points: 7
Solved Threads: 0
 

http://tomcat.apache.org/tomcat-6.0-doc/index.html

And Read Chapters 1 - 4 of the User Guide portion.

masijade
Industrious Poster
Moderator
4,253 posts since Feb 2006
Reputation Points: 1,471
Solved Threads: 494
 

hi

open:
1 tomcat5.5
2.webapps folder
3.in webapps copy "web inf" and "lib" folder make sure that the lib folder contains all jar files reqrd.(asp.,jsp,servlet)
4. make ur own program folder in webapps itself.
and write ur jsp program with .jsp extensio.

then define the class path thru the my comp advace feature


try............. and enjoy

sandipdandel
Newbie Poster
8 posts since Aug 2009
Reputation Points: 10
Solved Threads: 0
 

hi

open: 1 tomcat5.5 2.webapps folder 3.in webapps copy "web inf" and "lib" folder make sure that the lib folder contains all jar files reqrd.(asp.,jsp,servlet) 4. make ur own program folder in webapps itself. and write ur jsp program with .jsp extensio.

then define the class path thru the my comp advace feature

try............. and enjoy


You just provided badly written answer to something that was answered with link to appropriate well written documentation

peter_budo
Code tags enforcer
Moderator
15,436 posts since Dec 2004
Reputation Points: 2,806
Solved Threads: 902
 

Hi,

I have created the folder structure.... but tell me out to write the classpath, i dont know...

one more doubt i have my servlet program given below.

import java.io.*;
import javax.servlet.*;
import javax.servlet.http.*;
public class valid extends HttpS ervlet
{
   public void doGet(HttpServletRequest req, HttpServletResponse res)throws IOException,ServletException
	{
	   res.setContentType("text/html");
	   PrintWriter out = res.getWriter();
	   String name = req.getParameter("name");
	   String password = req.getParameter("password");
	   out.println("<html>");
	   out.println("<head>");
	   out.println("<title> login page </title>");
	   out.println("<body>");
	   out.println("Name "+ name);
	   out.println("");
	   out.println("your password is " + password );
	   out.println("</body>");
	   out.println("</html>");
	   out.close();
	} //end of service

} //end of class

and my index.html file given below

<html>
<head><title>Login Page</title></head>
<body>
<form method=get action="/Library/login">
<table>
 <tr>
  <td>Name: </td>
  <td><input type="text" Name="name"></td>
</tr>
 <tr>
 <td>Password:</td>
 <td><input type="password" Name="password"></td>
 </tr>
 <tr>
 <td><input type ="submit" value="submit"></td>
 <td>&nbsp;</td>
 </tr>
 </table>
 </body>
 </html>


and my web.xml code
LibraryvalidLibrary/Library/login

how to write xml mapping,,,,,,,,i am getting an error,, Library/login not found and i am able to open index.html file , when i write http://localhost:8080 and after that i wil get above mentioned error......my folder structure is.......in webapps, i have created Library and in library, html file folder, WEB-INF and lib folders and index.html is their and in WEB-INF , src , classes and web.xml folders are their is this write and exactly where should be my jsp folder.................please reply .............its URGENT

ishlux
Junior Poster
145 posts since Jun 2008
Reputation Points: 7
Solved Threads: 0
 

You don't have to "write a classpath" for web apps.

You place any jar you need in the web-apps WEB-INF/lib directory, except JDBC libs may need to be placed in the "shared/lib" directory of tomcat.

Your own classes are to be placed in the WEB-INF/classes directory (with each package being a directory, as normal).

And give your class a package, that is a must. You should never write a class without a package. And classnames should be capitalised (not needed but it is standard, and, from most programmers, expected).

So, now assume you change valid to give it a package of authentication , and change the name from valid to Validator , the servlet-class would then be, of course, authentication.Validator , and that class will be located in WEB-INF/classes/authentication/Validator.class

All of this (except the need for a package and classnames which arebasic java) is explained in the linked to Manual.

masijade
Industrious Poster
Moderator
4,253 posts since Feb 2006
Reputation Points: 1,471
Solved Threads: 494
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You