Solved

executing code in jsps

Posted on 2003-10-23
8
178 Views
Last Modified: 2010-04-01
Hi
I am trying to run some jsp pages but although the html appears the jsp code does not run

I am running both Apache and IIS - do I need to have Tomcat running as well? which version should i be downloading...there seem to be a whole raft of choices as to what to download; which one should I download and install - do I need to install more than one file?
thanks
0
Comment
Question by:lz7cjc
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 3
8 Comments
 
LVL 12

Expert Comment

by:ahosang
ID: 9605933
we'd have to see your jsp code. What's not running?
0
 

Author Comment

by:lz7cjc
ID: 9606779
here you go - there are two pages

first page:
<html>
<head>
<title>
Adding up two numbers - JSP Example 2
</title>
</head>
<body>
<h1>
Adding up two numbers - JSP Example 2
</h1>
<p>
<form method=GET action="http://www.scit.wlv.ac.uk/jsp/home/staff/acad/jphb/public_html/sst/jsp/ex2.jsp">
<p>
<table>
<tr><td>Enter first number<td> <input type=text name="n1">
<tr><td>Enter second number<td> <input type=text name="n2">
<tr><td> <td><input type=submit value="Calculate sum">
</table>
</body>
</html>


calls this page:
<html>
<head>
<title>
JSP Example 2
</title>
</head>
<body>
<h1>JSP Example 2</h1>
<%
      String      sn1;
      String      sn2;
      int n1,n2;
      sn1 = request.getParameter("n1");
      sn2 = request.getParameter("n2");
      n1 = Integer.parseInt(sn1);
      n2 = Integer.parseInt(sn2);
      out.println("The numbers were " + sn1 + " and " + sn2);
      out.println("<br>");
      out.println("The sum is " + (n1+n2));
%>
</body>
</html>

and only "JSP Example 2" prints out on the page
0
 
LVL 15

Expert Comment

by:jimmack
ID: 9606865
Yes.  You do need to have a Servlet container running (eg. Tomcat).

Tomcat 4 is a good stable release (http://jakarta.apache.org/tomcat/index.html)

It's a 4.1.27 at the moment.

I've always found the Tomcat installation process quite painless, but I've not tried to link it with Apache or IIS (I currently run it standalone).

To start with, I'd recommend you do the same and simply let it run on it's default port of 8080.

Without the container, your JSP will just be displayed as HTML (as you are finding) ;-)

Your JSP page will need to appear under a directory in the Tomcat "webapps" directory in order for Tomcat to find it (and compile and run it).

Good luck ;-)

Jim.
0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

Author Comment

by:lz7cjc
ID: 9606887
thanks I have follow up questions but will post different questions for them
0
 

Author Comment

by:lz7cjc
ID: 9606897
however I do need to know what I am meant to be downloading since there seem to be a whole host of options under downloads
thanks
0
 
LVL 15

Expert Comment

by:jimmack
ID: 9606940
You are absoultely right.  They've changed the site since my last download and it's a real mess now.

Give me a few minutes and I'll get back to you with a link.

Jim.
0
 
LVL 15

Accepted Solution

by:
jimmack earned 125 total points
ID: 9606972
OK,

Go to the binaries download page:

http://jakarta.apache.org/site/binindex.cgi

I think you want the following link:

http://mirrors.ccs.neu.edu/Apache/dist/jakarta/tomcat-4/binaries/jakarta-tomcat-4.1.27.exe

This is the "4.1.27 exe" link from the following section:

Tomcat 4.1.27 KEYS

    * 4.1.27 zip PGP MD5
    * 4.1.27 tar.gz PGP MD5
    * 4.1.27 exe PGP MD5

Jim.


(I'm not very impressed with their new layout.  Surely it would make more sense to have the basic distros listed first!)
0
 
LVL 15

Expert Comment

by:jimmack
ID: 9607011
I've sent an e-mail to the webmaster asking if they wouldn't mind changing the layout ;-)
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Why do some people recommend buying business VoIP from an ISP? What are the benefits to my company? What are the costs?
Originally, this post was published on Monitis Blog, you can check it here . In business circles, we sometimes hear that today is the “age of the customer.” And so it is. Thanks to the enormous advances over the past few years in consumer techno…
If you’ve ever visited a web page and noticed a cool font that you really liked the look of, but couldn’t figure out which font it was so that you could use it for your own work, then this video is for you! In this Micro Tutorial, you'll learn yo…
In this video you will find out how to export Office 365 mailboxes using the built in eDiscovery tool. Bear in mind that although this method might be useful in some cases, using PST files as Office 365 backup is troublesome in a long run (more on t…

632 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question