Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

compiling jsp  RSS feed

 
Vasantha Ajjampudi
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi
I have just started working on jsp pages. how do I compile my jsp page and view it.Using tomcat server. I know tomcat has jasper compiler to compile jsps. do I have to set any class path for this to use the compiler?
so please tell me how to compile and run a jsp page.

Thanks in advance.
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 66207
151
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
As this is a Tomcat setup issue, moving to the Tomcat forum.
[ September 08, 2004: Message edited by: Bear Bibeault ]
 
Bruce Jin
Ranch Hand
Posts: 672
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You only need to put jsp in Tomcat app (example webapp for example) and run it from browser, Tomcat will compile it.
 
Vasantha Ajjampudi
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks bruce for ur reply.
But its not working that way.. I have a html page that calls this jsp page.. I can see the values (entered in html) in the url after submitting the page but these values r not being displayed in jsp page..
using request.getParamter()to retrieve values from previous page and displaying.

any ideas?
 
Mike Curwen
Ranch Hand
Posts: 3695
IntelliJ IDE Java Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
what do you see in the address bar? (copy and paste it into your message, the entire thing)

what is your JSP code ?
 
Vasantha Ajjampudi
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi

In my html file Iam entering firstname lastname and mail id . so after I click submit button my address bar show this

file:///C:/servjsps/showmail.jspfname=john+&lname=smith&email=john@hotmail.com

jsp code:

<html>
<head>
<Title>Displaying Details</Title>
</head>
<body>
<%
String firstName = request.getParameter("fname");
String lastName = request.getParameter("lName");
String mailId = request.getParameter("email");

%>
<h1>Thanks for joining our mailing list</h1>
<p>Here are the details you have entered</p>

<table cellspacing = "5" cellpadding="5">
<tr>
<td align ="right">First Name</td>
<td><%=firstName%></td>
</tr>
<tr>
<td align ="right">Last Name</td>
<td><%=lastName%></td>
</tr>
<tr>
<td align ="right">Email Id</td>
<td><%=mailId%></td>
</tr>
</table>

<form action = "MailList.html" method="post">
<input type = "submit" value = "Return">
</form>
</body>
</html>


the jsp page is not displaying the retrieved values

thanks
 
Mike Curwen
Ranch Hand
Posts: 3695
IntelliJ IDE Java Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The first part of your address bar:
file:///C:/

is a problem. It means the browser is not actually submitting to the JSP page.

Also, where is the question mark that separates the page name from the querystring?

showmail.jspfname
should be
showmail.jsp?fname
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!