aspose file tools*
The moose likes JSP and the fly likes Jsp's Problem Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Soft Skills this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Java » JSP
Bookmark "Jsp Watch "Jsp New topic
Author

Jsp's Problem

Ryan Nguyen
Greenhorn

Joined: Jul 23, 2005
Posts: 5
I have problem with my first JSP page on the server(remote site).

At the server (remote site), In the /var/www/html, i create a temp directory. In the temp dir, i created WEB-INF and place my HelloWorld.jsp. In the WEB-INF, i also create the classes and lib directory. But i cannot view my JSP from the Internet Explorer, the IE ingnores all the JSP tags, it just displays the HTML contents.

Thank you for your help so much, i am looking for your reply.
[ July 23, 2005: Message edited by: Bear Bibeault ]
Andrew Moores
Greenhorn

Joined: May 28, 2005
Posts: 12
Ryan

You didn't mentioned the web server you are using to access the JSP. It sounds like you aren't accessing your JSP via a suitable servlet container such as Tomcat. If you're using Tomcat you need to have a web.xml file in the WEB-INF directory and you'll need to modify the Tomcat server.xml file if you want to locate your JSPs outside of the standard Tomcat directories as you are attempting to do.

Give me some more info about your set-up and I'll help you get it working.

Regards
Andrew
Ryan Nguyen
Greenhorn

Joined: Jul 23, 2005
Posts: 5
Andrew,

First, i want to thank to you for taking time to read my posting.

I am using the TOMCAT to access my JSP pages at the server, version 4.

Can you tell me where can i locate the server.xml at the server site, i cannot find it. And i am just a beginer, so can you give me the simple content of web.xml to run my helloworld.jsp ?

According to the hosting vendors, the host supports TOMCAT, JSP/Servlet/Java, BUT how can i check it ? Please help me.

Thank you very much and looking for your reply.

Best Regards.
Andrew Moores
Greenhorn

Joined: May 28, 2005
Posts: 12
Ryan

My advice would be to initially get things working on your local PC before trying to get it working with a web host. Get the relevant download from the Tomcat site and install it on your PC. This will allow you to play around with the config. The way that web hosts provide Tomcat as a service differs, some don't allow you access to the server.xml file and some do. They may want you to upload your web applications as a war file that will be automatically deployed. Either way they should supply you with detailed instructions on how to do this. Who is your hosting company? Do you have any documentation regarding Tomcat from them? It may be that you html directory has been mapped as web app in server.xml and that you need to create a WEB-INF sub-directory here. You'll still need a web.xml file in WEB-INF.

It will help you if you have something that you know works before you attempt to get it working with a third party. Installing Tomcat under Windows is a breeze. Once installed you can look at the conf directory and see the server.xml file, it has comments regarding the structure and you should read them through. You will also see a directory called webapps, this is where the web applications live by default. Have a look in the jsp-examples sub-directory and you'll see how things should be organized and some good examples.

Let me know how you get on.

Andrew
Ryan Nguyen
Greenhorn

Joined: Jul 23, 2005
Posts: 5
Andrew,
Thank you for your advice, actually I have tried my JSP at my PC already and everything works fine, and now I want to try to it on the real server.

I have register a host at Astrahosting.com, the regular plan (www.astrahosting.com)and i dont have any TOMCAT documentation from them.

Anyway, Thank you very much.
Best Regards.
Andrew Moores
Greenhorn

Joined: May 28, 2005
Posts: 12
Ryan

Try creating a WEB-INF sub-directory and mive the web.xml file from you local set-up on the server. If everything works well on your local PC then you need help from the web host. Did you use Tomcat on your local PC to test the JSP?

Regards
Andrew
Ryan Nguyen
Greenhorn

Joined: Jul 23, 2005
Posts: 5
Andrew,

At the local PC, i have used TOMCAT, version 5.5.9 to test my helloworld.jsp.

At the local PC, in the webapps dir, i create a temp folder. Inside the temp folder, i place my helloworld.jsp and create a WEB-INF, in WEB-INF i create the lib and classes dir. I test my JSP by 127.0.0.1/temp/helloworld.jsp. Everything is OK.

Can i do the same thing at the server side? i mean without the web.xml

Thank you !
Regards.
Andrew Moores
Greenhorn

Joined: May 28, 2005
Posts: 12
Ryan

Like I said it depends on how your web host supports Tomcat, they should be able to give you a guide on how to get a web app going.

The way you have got your JSP working could be better. If you want to build on this example produce a web app including servlets, etc you'll need to get a web.xml file and understand how it works.

Regards
Andrew
Ryan Nguyen
Greenhorn

Joined: Jul 23, 2005
Posts: 5
Thank you very much Andrew, I will try to do it ! Do you have any ebook talks about JSP ?

Once again, thank you for your help so much !

Best Regards,
Ryan
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Jsp's Problem