Solved

executing code in jsps

Posted on 2003-10-23
8
176 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

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!

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
maven project in eclipse 11 62
immutable object concept 5 143
Clear browser cache on site login, is it possible? 3 38
ArrayList Adding/settign data 3 38
By reading this blog, MSPs will gain insight into how to improve communications with their clients as well as establish a more profitable business.
How many times a day do you open, acknowledge, or close an IT incident? What’s your process? Do you have a process depending on the incident, systems involved, and other factors? New Relic Alerts gives you options for how you interact with notifica…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…

739 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