Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Please Help me with JSP! 1

Status
Not open for further replies.

Guest_imported

New member
Jan 1, 1970
0
Hi. I learned Java for a year, and I just started learning JSP. My biggest problem is that I did not have any concept of server. I got a book, Core Servlets and JavaServer Pages. This books often talks about &quot;server&quot;. I am very confused. I know how to write code but I do not sure about how to run and creat .jsp code. Everytime I compiled, I always get .class files, of course. Is there any nice website which talks about all those details. I am also confused with installation Tomcat. I download and install in my compater(<- my comptuer is not server). What am I supposed to do with Tomcat?

I am so sorry. I just can't understand how this JSP works.
 
WE r in the process of customizing a reporting tool which is called WebIntelligence using JSP. We use weblogic as the application as well as the webserver. we have a jar file which contains some classes which r included in the jsp as beans. when i run the jsp file, it gives a parsing error saying class not found. i have included the jar file in the classpath. Since i'm new to jsp , i have not been able to figure out the problem. can anyone please help out ???
 
MrBabe:

JSP files are compiled the first time they are accessed by the web server, and only again if the server is restarted or forces a refresh. So, you yourself don't have to compile the JSP as you would a servlet or Java file into a .class.

What you need however is a Web server and a Servlet Engine to connect to the Web server. These two components will allow you to serve JSP pages.

Tomcat is a very good servlet engine but it's complicated for the newbie. I suggest you try Allaire JRun ( which has a free developers version and Apache Web server from Install Apache first, then JRun, and use the connector wizard to connect them both together. It's all self explanatory.

Once you've installed JRun, create a new web application. This is where you put your JSP files. Thankfully, you've got one of the best books by Marty Hall, so just pick one of his examples and write the JSP file in notepad or some other editor and save it in your new web application.

That should do it.

BO:

Class names are case sensitive, check you've typed it right. Check you've included the package name in the useBean tag, and make sure you're importing any required packages using <%@ page import = &quot;java.io.*,java.util.*&quot;> etc. Failing that, make sure your servlet engine knows about the classpath.

Here's an example useBean:

Code:
<%@page language=&quot;java&quot; %>
<%@page import=&quot;java.io.*&quot; %>
<jsp:useBean id=&quot;test&quot; scope=&quot;session&quot; class=&quot;TestBean&quot; />

<%
	String blah  = test.MyFunction();
	out.println(blah);
%>

Bye for now,

Tim --
Tim <tim@planetedge.co.uk>
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top