• 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
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

To change JDeveloper target url

 
Ranch Hand
Posts: 73
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello everybody..
I have written a sample web-application "test" on JDeveloper contaning 2 servlets(Servlet1 ,Servlet2). They are contained in a package "com.gov.servlets".
Now even though i mention my url as "/servlet/Servlet1" and "/servlet/Servlet2" , the TARGET URL that JDeveloper checks is

http://192.145.3.23:8989/test/servlet/com.gov.servlets.Servlet1

what should i do so that "com.gov.servlets" does not appear in the URL ?

I have already tried everything in Project Properties but i could not find anything that made a difference .

Please help ...
 
author & internet detective
Posts: 41860
908
Eclipse IDE VI Editor Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Add a servlet mapping to the web.xml. For example:


Also, check you aren't forwarding anywhere after the servlet executes.

I'm moving this to our servlet forum as it isn't JDeveloper specific.
 
gov kur
Ranch Hand
Posts: 73
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I have provided the servlet mapping in web.xml as
-----------------------------------------------------------
<servlet>
<servlet-name>Servlet1</servlet-name>
<servlet-class>com.gov.servlets.Servlet1</servlet-class>
</servlet>

<servlet-mapping>
<servlet-name>Servlet1</servlet-name>
<url-pattern>/servlet/Servlet1</url-pattern>
</servlet-mapping>

-----------------------------------------------------------------

also i have ensured that Servlet1 is my Default Run Target.. inspite of this the Target URL generated by the Embedded OC4J Server is
"http://192.145.3.23:8989/test/servlet/com.gov.servlets.Servlet1" and not "http://192.145.3.23:8989/test/servlet/Servlet1".



Please Help...
 
gov kur
Ranch Hand
Posts: 73
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello People...

just got the answer...it seems that the WEB.xml that is generated automatically by the JDeveloper( with all the servlet mapping and all) was being placed in public_html while another harmless WEB.xml was present in WEB-INF that basically has none of the mappings in it..

inspite of this JDeveloper was able to read my application folder structure and as a result was generating the url with the entire Package path in it.

Just glad thats done with...and i guess shows that one needs to get the basics right first .... CHEERS
 
So there I was, trapped in the jungle. And at the last minute, I was saved by this tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic