• Post Reply Bookmark Topic Watch Topic
  • New Topic

To change JDeveloper target url

 
gov kur
Ranch Hand
Posts: 73
  • Mark post as helpful
  • send pies
  • 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 ...
 
Jeanne Boyarsky
author & internet detective
Marshal
Posts: 35716
412
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • 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
  • 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
  • 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
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!