• 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

Breaking the path roadblock....

 
village idiot
Posts: 1208
1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
/**
* The servlet url is defined by the app server config files. The base url
* plus /servlet/ is the default in Orion.
*
* For example, if request.getRequestURI() returns "/videos/addvideos.jsp",
* the path returned will be "/videos/servlet/". (The relative path would be
* "servlet/VideoServlet)"
*
* @param request
* @return the jsp document path plus the directory where the app server expects
* to find the servlets ending with a slash.
*/
public static String getPathFromJSPToUnMappedServlet( HttpServletRequest request )
{
return getBasePath( request ) + "servlet/";
}

/**
This comes from the documentation in PathFinder.java. I'm working on getting the input from addvideo.jsp to VideoServlet, but for some reason VideoServlet remains hidden to my browser. If I understand the documentation here (!) the form in addvideo will post the input parameters to this location:

PathFinder.getPathFromJSPToUnMappedServlet( request ) + "VideoServlet"

which would be this on my system:

orion/applications/videos/servlet/VideoServlet.

The location of this servlet is actually: orion/applications/videos/WEB-INF/classes/com/javaranch/drive/videos/VideoServlet.java

Do I have everything set up right? The package statement in VideoServlet is:
package com.javaranch.drive.videos ;
Why can't my browser see this servlet?
 
Sheriff
Posts: 9109
12
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
What do you have in your web.xml?
 
Carol Murphy
village idiot
Posts: 1208
1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Aha! This is the web.xml that was inside videos/WEB-INF/
The thing is, I edited this for VideoServlet, but now it has reverted to Reverse2Servlet, but I don't know why. I'm going to try commenting out the Reverse2Servlet and adding VideoServlet in its own tags.
This isn't the first time I've edited a file, only to have the original version from before the edit show up in the war file. What's up with that?

<?xml version="1.0"?>
< !DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.2//EN" "http://java.sun.com/j2ee/dtds/web-app_2_2.dtd">;

<web-app>
< !-- A demo servlet, add servlets below -->
< !--<br /> <servlet><br /> <servlet-name>BeeServlet</servlet-name><br /> <servlet-class>com.javaranch.drive.BeeServlet</servlet-class><br /> </servlet> -->
<servlet>
<servlet-name>Reverse2Servlet</servlet-name>
<servlet-class>com.javaranch.drive.Reverse2Servlet</servlet-class>
</servlet>
<servlet>
<servlet-name>snoop</servlet-name>
<servlet-class>SnoopServlet</servlet-class>
</servlet>
</web-app>
 
Carol Murphy
village idiot
Posts: 1208
1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hmm, I must have changed the web.xml file in some location other than the java.resources file. I edited the file there, and now VideoServlet is visible. Doesn't work right yet, but it's visible. Thanks!
 
reply
    Bookmark Topic Watch Topic
  • New Topic