• 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

How set "launch configuration" in Eclipse?

 
Ranch Hand
Posts: 72
Eclipse IDE Firefox Browser Tomcat Server
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello,

I am running Eclipse Indigo against Tomcat. My servlet is running fine but I'd like to specify a "launch configuration" so that the starting URL submitted to to Tomcat has a Query String.

My web.xml specifies:

<servlet>
<servlet-name>MyServlet</servlet-name>
<servlet-class>com.domainname.projectname.MainClassName</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>MyServlet</servlet-name>
<url-pattern>/run/*</url-pattern>
</servlet-mapping>

When I run the servlet in Eclipse (<F11>) I see the URL of the native browser comes up as:

http://localhost/MainClassName/run/*

However, what I need to launch with is (append the "?p=123")"
http://localhost/MainClassName/run?p=123

I've experimented with<url-pattern> in web.xml. In addition, I have also tried using the Project's Properties' Run/Debug Settings. Either these are not the right way to do this or I am using them wrong.

Can someone tell me how to get Eclipse to launch with the URL above?

Thank you.
 
Saloon Keeper
Posts: 27808
196
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Welcome to the JavaRanch, Al!

Eclipse doesn't submit ANY URLs to Tomcat. Eclipse itself doesn't even understand J2EE, so what J2EE support you get comes from plug-ins. Several of the Eclipse.org downloads come with such plugins pre-installed.

However, none of them make requests to Tomcat or any other webapp server. They figure that's the client's job, and Eclipse is just responsible for the IDE and the debugger and maybe launching/controlling the Tomcat server.

The URL patterns in web.xml are what Tomcat uses to figure out where to send URL requests. So for example, you've told Tomcat that URLs whose post-context URLs begin with /run/ will be routed to MyServlet.

Or, in other words, nothing in web.xml has to do with sending URLs, only in what to do with them when they are received.
 
Al Koch
Ranch Hand
Posts: 72
Eclipse IDE Firefox Browser Tomcat Server
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Tim,

Thanks for the reply; I'm new to Eclipse so sorry for being a bit vague.

I am running Eclipse with the Sysdeo plugin. I realize that Eclipse is "just" a framework that we hang plugins on but I'm not sure where else to ask my question which I think many other people must have.

My understanding of web.xml is that it just tells Tomcat what class to execute when "something sends" it a particular URL (which is what you said) so I'm not surprised that it is not the solution. But Eclipse does show (or is it the Sysdeo plugin?) the Properties > Run/Debug Settings window which "sounds" like what I need but I don't see how to make that work for me. But no matter what, Eclipse must be involved in some fashion in launching the servlet because <F11> causes http://localhost/MyProject/run/* to be sent to Tomcat. (I can see this URL in the Eclipse "internal" browser window).

So, can you tell me how/"who" is sending that URL to Tomcat when I push <F11>? I can't be the only person who wants to launch a servlet out of Eclipse with a URL that has a query string on the end. Since I'm launching using Eclipse's <F11> it seems like this forum is the place to ask about this but if you know where I should be posting please let me know.

Thanks for your help.

Al
reply
    Bookmark Topic Watch Topic
  • New Topic