struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Hajratwala, Nayan (N.)" <>
Subject RE: how to invoke the action servlet?
Date Thu, 27 Mar 2003 20:42:00 GMT
I think you'll want to go to http://localhost:8080/ginsu/

The first "ginsu" is the name of your webapp, the second "" part will invoke the ActionServlet.
 This is because your web.xml indicates that anything with *.do should go to the ActionServlet.

The ActionServlet will check the struts-config.xml file and see that since you are looking
for, it should find the action named "ginsu", which is your first defined action-mapping.

Hope this helps!

- Nayan Hajratwala
- Chikli Consulting LLC

-----Original Message-----
From: Dan Tarkenton [] 
Sent: Thursday, March 27, 2003 3:32 PM
Subject: how to invoke the action servlet?

I have been referencing the book Struts in Action by Ted Husted as well as the struts site.
I cannot figure out what to point my browser to in order to invoke struts. I have zero JSPs
in my struts application -- I have no need for them because I am utilizing Model X where I
have one XSLT servlet that represents my entire view layer. I thought I could just point my
browser to http://localhost:8080/ginsu (ginsu being the name of my web app). I realize I have
no index.html or index.jsp, but I'm just trying to go directly to the action servlet from
the browser. 

Is this not possible in struts? 

Here is my struts-config file: 

<?xml version="1.0" encoding="ISO-8859-1" ?> 
<!DOCTYPE struts-config PUBLIC 
"-//Apache Software Foundation//DTD Struts Configuration 1.0//EN" 
<!-- ========== Form Bean Definitions =================================== --> 

<!-- Example logon form bean 
<form-bean name="logonForm" 
<form-bean name="contentForm" type="ginsu.ContentForm" /> 


<!-- ========== Global Forward Definitions ============================== --> 
<!-- Example logon forward 
<forward name="logon" path="/logon.jsp"/> 
<!-- ========== Action Mapping Definitions ============================== --> 

<action path="/ginsu" 
<!-- we want the xslServlet forward path attribute to point to XSL Servlet --> 
<forward name="xslServlet" path="/XSLServlet" /> 

<action path="/admin/addFormBean" 
<action path="/admin/addForward" 
<action path="/admin/addMapping" 
<action path="/admin/reload" 
<action path="/admin/removeFormBean" 
<action path="/admin/removeForward" 
<action path="/admin/removeMapping" 


And here is my web.xml file: 

<?xml version="1.0" encoding="ISO-8859-1"?> 

<!DOCTYPE web-app 
PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.2//EN" 

<!-- Standard Action Servlet Configuration (with debugging) --> 
<!-- XSLT Servlet (View component)--> 
<!-- <init-param> 
<load-on-startup>1</load-on-startup> --> 

<!-- XSLTServlet Mapping --> 

<!-- Struts Action Servlet Mapping --> 

<!-- The Usual Welcome File List --> 

<!-- Struts Tag Library Descriptors --> 






I noticed that there is an element: 


Is this an absolutely necessary element in the web.xml file? I figure the index.jsp would
just contain a redirect to the action servlet. 

Any help is appreciated. Thanks!

Do you Yahoo!?
Yahoo! Platinum - Watch CBS' NCAA March Madness, live on your desktop!

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message