jQuery in Action, 3rd edition
The moose likes Cattle Drive and the fly likes Breaking the path roadblock.... Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Make it so: Java DB Connections & Transactions this week in the JDBC forum!
JavaRanch » Java Forums » This Site » Cattle Drive
Bookmark "Breaking the path roadblock...." Watch "Breaking the path roadblock...." New topic

Breaking the path roadblock....

Carol Murphy
village idiot

Joined: Mar 15, 2001
Posts: 1202
* 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:


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?
Marilyn de Queiroz

Joined: Jul 22, 2000
Posts: 9058
What do you have in your web.xml?

"Yesterday is history, tomorrow is a mystery, and today is a gift; that's why they call it the present." Eleanor Roosevelt
Carol Murphy
village idiot

Joined: Mar 15, 2001
Posts: 1202
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">

< !-- 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> -->
Carol Murphy
village idiot

Joined: Mar 15, 2001
Posts: 1202
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!
I agree. Here's the link: http://aspose.com/file-tools
subject: Breaking the path roadblock....
It's not a secret anymore!