• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • Ron McLeod
  • paul wheaton
  • Jeanne Boyarsky
Sheriffs:
  • Paul Clapham
  • Devaka Cooray
Saloon Keepers:
  • Tim Holloway
  • Roland Mueller
  • Himai Minh
Bartenders:

How to set context-root for web application in 6.1

 
Ranch Hand
Posts: 46
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
How do I set context-root for web application in 6.1 when using the exploded directory format for deploying.
I think for deploying using the EAR, I can set the context-root element in application.xml.
But I tried to put the context-root element in my weblogic.xml which is placed under WEB-INF directory. As expected I got the SAX exception because, the dtd for version 6 doesnot have any element named context-root.
Please help
Thanks in advance
Pradeep
 
Ranch Hand
Posts: 1871
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
If I remember right the folder name of your webapplication is the context root.
 
Rahul Mahindrakar
Ranch Hand
Posts: 1871
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
This is when you want to deploy only the web application and not a ear.
 
Pradeep Sahoo
Ranch Hand
Posts: 46
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks Mahindrakar,
But I actually wanted to set the context root to nothing. WHich means I wanted to access my webapp without using the /webappname/resource URL. Instead I should be able to access it using /resource as the URL as is the case with the DefaultWebApp provided in 6.1.
I came to know that in Weblogic 7.0 there is an option by which I can have an element named context-root set up in the weblogic.xml present in the WEB-INF folder of my web app.
All these problems come because I want to deploy using the exploded directory format instead of EAR.
Thanks once again,
Pradeep
 
Rahul Mahindrakar
Ranch Hand
Posts: 1871
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Now I get it that you want to set this web application as your default application.
Why havent you tried out what Chris Mathews has explained
here very clearly. The same steps have to be followed whether it is a 6.1 application or a 7.0 application.
I have verified this too.
However here is a slight correction
Open up the WebLogic console. Select your server, click on the Connections tab. Then select the HTTP tab, select your default web application from the drop-down of Default Web Application. Restart the server. Done.
Please Note the name that is in the popup will be the name of the directory where you have unzipped the web application you have specified.
 
Pradeep Sahoo
Ranch Hand
Posts: 46
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks Mahindrakar,
In fact I had thought that by setting my web app to default I would be able to access it without having to specify a context path in the URL. But it didn't work although my webapp is now the default.
So I thought probably by setting the context-root of my web-app to nothing,I should be able to access it(without the context-path).
In fact I had posted that question(in a different forum link) earlier than this one.
Hope I am able to convey my problem
Thanks once again,
Pradeep
 
Ranch Hand
Posts: 8946
Firefox Browser Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Pradeep,
your problem has been well understood.
I am surprised by what u have posted. By making a web application a default one it worked perfectly fine for me.
To quote from BEA doc -
"If you declare a default Web Application that fails to deploy correctly, an error is logged and users attempting to access the failed default Web Application receive an HTTP 400 error message."
One more thing - Have u restarted the server after making configuring the default web app from admin console.
I am not sure whether server restart is required but give a try.

Originally posted by Pradeep Sahoo:
Thanks Mahindrakar,
In fact I had thought that by setting my web app to default I would be able to access it without having to specify a context path in the URL. But it didn't work although my webapp is now the default.
So I thought probably by setting the context-root of my web-app to nothing,I should be able to access it(without the context-path).
In fact I had posted that question(in a different forum link) earlier than this one.
Hope I am able to convey my problem
Thanks once again,
Pradeep

 
Ranch Hand
Posts: 2713
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Yes a server restart is required. The other thing you will want to check is the logs. Make sure that your servlet is being deployed. The logs will also tell you what context the servlet was bound to.
 
Pradeep Sahoo
Ranch Hand
Posts: 46
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks Pradeep and Mahindrakar,
My problem is solved now
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic