This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Websphere and the fly likes WAS 5 and JSP Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Products » Websphere
Bookmark "WAS 5 and JSP" Watch "WAS 5 and JSP" New topic
Author

WAS 5 and JSP

Reda Mokrane
Ranch Hand

Joined: Jul 25, 2001
Posts: 237
Hi,
Could anyone please tell me in which dir I should place my JSPs in WAS 5.
Thanks
Kyle Brown
author
Ranch Hand

Joined: Aug 10, 2001
Posts: 3892
    
    5
In a WAR file.
Kyle


Kyle Brown, Author of Persistence in the Enterprise and Enterprise Java Programming with IBM Websphere, 2nd Edition
See my homepage at http://www.kyle-brown.com/ for other WebSphere information.
Reda Mokrane
Ranch Hand

Joined: Jul 25, 2001
Posts: 237
Thanks Kyle for the quick answer but.
I want to know in which dir should i put my JSP page during the development, so that I can see test it.
Tony
Graham Thorpe
Ranch Hand

Joined: Mar 25, 2002
Posts: 265
u can select the webdevelopment direcory and choose "jsp" then u can write ur jsp after that u can check the the direcory ...
Kyle Brown
author
Ranch Hand

Joined: Aug 10, 2001
Posts: 3892
    
    5
Originally posted by Tony Mokrane:
Thanks Kyle for the quick answer but.
I want to know in which dir should i put my JSP page during the development, so that I can see test it.
Tony

I was not kidding. I was dead serious. You MUST build a WAR file containing your JSP. Until there is a WAR file in place WebSphere will not allow you to run your JSP's. You can ADD a JSP to an existing WAR directory after the WAR has been installed (search the InfoCenter on "hot deployment"), but WAS doesn't let you just slam JSP's into a generic directory like other servers.
Kyle
Reda Mokrane
Ranch Hand

Joined: Jul 25, 2001
Posts: 237
Thanks Kyle for your cooperation.
few more questions:
1)Is there any workAround that I can do in order to run my JSPs without a WAR File?
2)Why can we run the Servlet but not the JPSs? is there any particular reason?
Thanks again
Tony Mokrane
Kyle Brown
author
Ranch Hand

Joined: Aug 10, 2001
Posts: 3892
    
    5
Originally posted by Tony Mokrane:
Thanks Kyle for your cooperation.
few more questions:
1)Is there any workAround that I can do in order to run my JSPs without a WAR File?
2)Why can we run the Servlet but not the JPSs? is there any particular reason?
Thanks again
Tony Mokrane

(1) No. This is as designed.
(2) What do you mean by "we can run the servlet but not the JSP's"? I don't understand the question...
Kyle
Reda Mokrane
Ranch Hand

Joined: Jul 25, 2001
Posts: 237
Hi!!!

(2) What do you mean by "we can run the servlet but not the JSP's"? I don't understand the question...

When I put the servlet in the class dir like:
C:\dev\WebSphere\AppServer\classes\MyServlet.class
I can run it. I dont need to put it in a WAR file.
Kyle Brown
author
Ranch Hand

Joined: Aug 10, 2001
Posts: 3892
    
    5
Originally posted by Tony Mokrane:
Hi!!!

When I put the servlet in the class dir like:
C:\dev\WebSphere\AppServer\classes\MyServlet.class
I can run it. I dont need to put it in a WAR file.


Yes, it runs, but you shouldn't do that. You're violating the Servlet spec -- you see, you've not declared this servlet in a WAR file, so there's no Deployment Descriptor to set it up. It HAPPENS to work since you have "load by classname" selected in the default application, but that's not the way you're supposed to use either Servlets or JSP's.
Please, go read the InfoCenter for WebSphere. Work your way through the tutorials. Perhaps even buy the Wrox book on WebSphere 5.0. You need to understand how the system works -- WebSphere follows the J2EE specifications VERY strictly, unlike some other servers like Tomcat -- you MUST package your Applications in J2EE component modules (WAR's, EJB-JARs and EARs). You use the AAT tool to do that. You then have to deploy your J2EE modules using the Admin console. The tutorials on the WebSphere site will help get you started with that.
Kyle
Reda Mokrane
Ranch Hand

Joined: Jul 25, 2001
Posts: 237
Thanks Kyle for your time. I'll follow your advice.
Thanks again
Tony
 
 
subject: WAS 5 and JSP
 
Similar Threads
How many strings are created?
Rules or exceptions?
How many languages do you speak ...
when 400 mark will reach?
Java EE version used in SCEA 5 310-052