Please help me get started... JSP

Hey, I'm brand new to web development. But I'd like to get into the field. For various reasons, I would like to start with JSP dev. I'm a C++ programmer, so concepts of OOP are not foreign to me. However, I don't have any idea as to where to start.

I have installed Forte 4.0 software, Apache-Tomcat software, Sun JDK1.3, and JRun 3.0. Now I'm stuck. Although I have set the CLASSPATH, JAVA_HOME, and TOMCAT_HOME roots, I cannot write, compile, debug, or execute JavaServer Pages.

Thank you for your time in assisting me.

Moshe

[564 byte] By [Shtarkman] at [2007-9-26 2:17:03]
# 1

Hi,

Still I am not sure, since you have done all the basic necessary things.

Anyhow please refer this URL for running and executing the simple JSP Application.

http://java.sun.com/products/jsp/html/jsptut3.html#13273

Please check for configuration of JSP with respect to Tomcat.

http://java.sun.com/products/jsp/html/jsptut2.html#23903

I hope this will help you.

Thanks

Bakrudeen

bakrudeen_indts at 2007-6-29 9:16:17 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 2

Hi,

For debugging

=============

It seems that JSP runtime errors are impossible to debug. The exception

thrown is always in some compiled servlet code. For example

java.sql.SQLException, java.lang.ArrayIndexOutOfBoundsException,

java.lang.NullPointerException and java.lang.ClassCastException. Is it

possible to debug runtime errors, other than printing multiple checkpoint

statements, which is not an efficient method?

SOLUTION:

There are no hard and fast rules to do that. It is very dependent on

your JSP engine. In general, you need to find where your .java files

are. You need to tell your JSP engine to leave them around. By default

most engines delete them after creating the .class file. It may get

tricky, though. Some engines put your HTML text into some kind of data

structure (an object dump, basically) so it is not stored in your .class

file. This makes your class files much smaller, and the HTML is not

stored on the VM's stack. This makes it very difficult to debug.

One suggestion is to use Forte for Java to do debugging of JSP codes. It can be

downloaded and purchased from http://www.sun.com/forte. The following is

a short tutorial to demonstrate how to debug a JSP file, set breakpoints,

and watch variable content values during runtime.

1) Set the compiler property for your JSP.

- Go to the Explorer window.

- Select your JSP file.

- Set the Servlet Compiler property to Internal Compilation.

(Hint: Use the context-sensitive Properties window.)

- Set the Debugger property to Servlet/JSPDebugging.

2) Now you will debug the JSP file by setting breakpoints, watching

variables, and switching between the JSP and corresponding servlet.

Set the breakpoint in your JSP file.

- Go to the Source Editor window.

- Select a few lines to watch

- Using the context-sensitive menu (right click), select Add/Remove

Breakpoint. This line will turn red to indicate that there is a

breakpoint for this line.

3) View the breakpoints in the corresponding servlet for your JSP file.

- Go the Explorer window.

- Select your JSP file.

- Using the context-sensitive menu, select View Servlet.

You will see the corresponding servlet in the Source Editor window.

At the bottom of the Sourde Editor window, you should see two tabs,

one for JSP and another for the corresponding servlet.

- Select the servlet's tab.

- Using the context-sensitive menu, select Clone view.

You should see a separate window with the servlet code and

breakpoints. These breakpoints automatically came from the JSP

file.

- Place the JSP file and corresponding servlet window side by side so

that you can simaltaneously view the execution of JSP as well as

the servlet.

4) Select some variables to watch during the execution.

- Go the window containing the servlet's source code.

- Using the context-sensitive menu, select Add Watch.

- In the resulting dialog box, enter a variable name for the Watch

Name.

- Click on the OK button.

- To view the watch variables, go to the Main menu and select View ->

Debugger. At the bottom of the Debugger window you should see a

tab named Watches.

- Select the Watches tab.

You should see the added variables.

5) To start the debugging session, go the Main menu and select Debug ->

Start Debugging.

The execution will stop at the first breakpoint in the JSP file.

If you see the servlet code, there are also execution will stop at

the first breakpoint.

- To continue the execution, go the JSP source code in the Source

Editor window and press Control-F5 to restart the debugger.

Execution will stop at the next breakpoint. In the servlet code,

execution will also stop at the next breakpoint.

- Go to the Debugger window and select the Watches tab to view the

contents of the variables.

6) If you set any breakpoints in the servlet code, those breakpoints

will automatically appear in the JSP file.

This way, you can set breakpoints in either JSP file or corresponding

servlet.

7) While executing the JSP, observe the contents of the variables in the

Debugger window.

8) Once execution has reached its end, close the debugger by going to

the Main menu and selecting Debug -> Finish Debugging.

For more tutorials and demo, please visit:

http://www.sun.com/forte/ffj/demo/online_demo.html

http://access1.sun.com/SRDs/srd_repository/F4JCE_SRD.ps

For information and online support, please visit:

http://forte.sun.com/cgi-bin/WebX

http://www.sun.com/forte/ffj

I hope this will help you.

Thanks

Bakrudeen

bakrudeen_indts at 2007-6-29 9:16:17 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 3

hi, first of all i'm sorry for posting my doubt here, i know this is not RMI Forum, but still i'm stuck with RMI-Firewall issue. Actaully RMI application works fine in LAN, but the requirement is, it should run behind the firewalls(over internet) RMIServer and RMIClient are residing in two different networks and the two networks are behind the firewall

what are all the steps and codings do i have to take for firewall tunneling in RMI ? Our RMI server and client are residing behind the firewalls.

1. In HTTP Tunneling technique, what i have to code in my exsiting RMI application and what are all the steps to be taken? and where i to configure the java.rmi.cgi-bin ?

2. In SocketFactory technique, what i have to code to my existing RMI application and what are all the steps to be taken? pls help me to How to start the HTTP Tunneling or Socketfactory or anything which makes works this RMI thru firewall. pls help me i'm very much under pressure

i have read the articles in the java.sun website, but still i didn't get the perfect solution for this RMI & Firewall Tunneling. It will be very helpful if you provide some sample codings and techniques for RMI & Firewall Tunneling. Does really any practical solution exist for RMI thru firewall, since it is not clear in java.sun website.

your response and guidance will be very much appreciatable and helpful.

-shafeeq

ShafeeqA at 2007-6-29 9:16:17 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 4

This is my development enviroment.... and i think is one of the easiest...

I have orionserver "www.orionserver.com" as my webserver installed which is free... and one of the fastest for JSP. For the JSP and JAVA hacking I use TextPad "www.textpad.com" which if you have JDK installed on your computer you are able to compile java files directly from the TextPad.

I don't use Apache/Tomcat or Jrun because I found this much more complicated to install and configure and of course that they "suck" to much memory.

superflyc at 2007-6-29 9:16:17 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 5
you should note that orion application server is only free for development and presentation, but needs to be licensed if used commercially.
Krakkat at 2007-6-29 9:16:17 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 6
I recommend u take the Marty Hall Core servlets and JSP from SUN. I started with this book and it was worth every penny i spend.Don't waste time asking question.All the answers are in that book. Bye.
manohar2 at 2007-6-29 9:16:17 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 7
If you notice I wrote:> This is my development enviroment....
superflyc at 2007-6-29 9:16:17 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...