GeeCON Prague 2014*
The moose likes BEA/Weblogic and the fly likes HelloWorld.jsp Is Jarred Into a .war File Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Products » BEA/Weblogic
Bookmark "HelloWorld.jsp Is Jarred Into a .war File" Watch "HelloWorld.jsp Is Jarred Into a .war File" New topic
Author

HelloWorld.jsp Is Jarred Into a .war File

JiaPei Jen
Ranch Hand

Joined: Nov 19, 2000
Posts: 1309
This HelloWorld.jsp works fine under the c:\...\DefaultWebApp_myserver directory using the WebLogic 6.0 and under the
c:\...\public_html directory using the WebLogic 5.1.0
I jarred this HelloWorld.jsp and create a Test.war file by
cd to the directory and typed
jar cv0f Test.war HelloWorld.jsp <enter>
How do I display "HelloWorld" in the browser using this Test.war file?
Michael Hildner
Ranch Hand

Joined: Oct 13, 2000
Posts: 297
In the URL after your document root, I think you would type /Test/HelloWorld.jsp. Not really sure because I mostly use jars.
JiaPei Jen
Ranch Hand

Joined: Nov 19, 2000
Posts: 1309
Can I draw this setence in accordance with your suggestion?
If I jar the HelloWorld.jsp into Test.jar, I can run and display "Hello world." by typing http:/localhost:7001/MyRoot/Test/HelloWorld.jsp in the browser.
Michael Hildner
Ranch Hand

Joined: Oct 13, 2000
Posts: 297
I believe that is correct. Let's see if it works.
JiaPei Jen
Ranch Hand

Joined: Nov 19, 2000
Posts: 1309
Both Test.jar and HelloWorld.jsp (which works fine by itself) are under the
c:\bea\wlserver6.0sp1
\config\mydomain\applications\DefaultWebApp_myserver
and I typed
http://localhost:7001/Test/HelloWorld.jsp
got message:
Error 404: Not Found
I cannot pinpoint the problem.
Michael Hildner
Ranch Hand

Joined: Oct 13, 2000
Posts: 297
I'm not really sure of the best way to organize these things, but this is how I have it setup:
I put my jars in the applications directory, the same place where console.war is. I can get to the console by typing http://localhost:7001/console. So my jar, named myjar.jar contains a myjsp.jsp. I can access this by typing http://localhost:7001/myjar/myjsp.jsp.
Hope this helps,
Mike
JiaPei Jen
Ranch Hand

Joined: Nov 19, 2000
Posts: 1309
Hi, Mike, I still can not make that HelloWorld.jsp work after I jarred the file into a .war file. It does not matter whether I can get Hello World on the screen or not. I am simply curious about how to work with .war files.
JiaPei Jen
Ranch Hand

Joined: Nov 19, 2000
Posts: 1309
Hi, Mike, I am reading the WebLogic 6.0 Administration document. The document makes me think if I want the jarred HelloWorld.jsp to work, I may need the web.xml, and weblogic.xml files specied and bundle them with the HelloWorld.jsp. What is your opinion? You are much advanced than I.
Michael Hildner
Ranch Hand

Joined: Oct 13, 2000
Posts: 297
Sorry I haven't been around, major deadline #$%!%#@
We do use both those xml's for deploying our web apps, but if I remember correctly, it's mostly servlet mappings.
I'll look at it some tonight. Lots of work to do...

Take a look at WebLogic's samples/examples/webapp directories for an idea on how to use those .xmls. Not a whole lot in there. Just for reference, when I open up my .war in WinZip, my .jsp is not underneath any directory. So I get to it by typing http://localhost:7001/mywar/myjsp.jsp
[This message has been edited by Michael Hildner (edited May 08, 2001).]
 
GeeCON Prague 2014
 
subject: HelloWorld.jsp Is Jarred Into a .war File