You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Rey Francois <Fr...@capco.com> on 2001/08/21 11:13:38 UTC
RE: session id
request.getSession().getId()
Fr.
-----Original Message-----
From: Mike Dewhirst [mailto:Dewhirst.M@UCLES.org.uk]
Sent: 21 August 2001 11:20
To: 'struts-user@jakarta.apache.org'
Subject: session id
Importance: High
how can i get the user session id within an Action class?
=**********************************************************
If you are not the intended recipient, employee or agent responsible for
delivering the message to the intended recipient, you are hereby notified
that any dissemination or copying of this communication and its attachments
is strictly prohibited.
If you have received this communication and its attachments in error, please
return the original message and attachments to the sender using the reply
facility on e-mail.
Internet communications are not secure and therefore the UCLES Group does
not accept legal responsibility for the contents of this message. Any views
or opinions presented are solely those of the author and do not necessarily
represent those of the UCLES Group unless otherwise specifically stated.
This footnote also confirms that this email message has been swept by
MIMEsweeper for the presence of computer viruses although this does not
guarantee that this email is virus free.
**********************************************************=
************************************************************************
The information in this email is confidential and is intended solely
for the addressee(s).
Access to this email by anyone else is unauthorised. If you are not
an intended recipient, you must not read, use or disseminate the
information contained in the email.
Any views expressed in this message are those of the individual
sender, except where the sender specifically states them to be
the views of Capco.
http://www.capco.com
***********************************************************************
Re: Strtus 1.0 and Tomcat 4.0
Posted by Rajan Gupta <rg...@yahoo.com>.
I am using Tomcat 4.0 b7 with struts 1.0 & it works great.
--- Bob Byron <rv...@yahoo.com> wrote:
> I am using Struts 1.0 with Tomcat 4.0 and it works
> well.
>
> Bob Byron
>
> --- Sarbjit Singh <si...@hotmail.com> wrote:
> > Hi, does Stutrs 1.0 work at all with Tomcat 4.0?
> > Is there a 1.1 version of struts that may work with
> > it?
> > Where can i find infor about working Struts 1.0 -
> > 1.1 with Tomcat 4.0
> >
> > Also, has anyone tried Struts with Sun Fote's
> > interal Tomcat?
> >
> > Thanks
> > Sarbjit
> >
>
>
> __________________________________________________
> Do You Yahoo!?
> Make international calls for as low as $.04/minute with Yahoo! Messenger
> http://phonecard.yahoo.com/
__________________________________________________
Do You Yahoo!?
Make international calls for as low as $.04/minute with Yahoo! Messenger
http://phonecard.yahoo.com/
Re: Strtus 1.0 and Tomcat 4.0
Posted by Bob Byron <rv...@yahoo.com>.
I am using Struts 1.0 with Tomcat 4.0 and it works
well.
Bob Byron
--- Sarbjit Singh <si...@hotmail.com> wrote:
> Hi, does Stutrs 1.0 work at all with Tomcat 4.0?
> Is there a 1.1 version of struts that may work with
> it?
> Where can i find infor about working Struts 1.0 -
> 1.1 with Tomcat 4.0
>
> Also, has anyone tried Struts with Sun Fote's
> interal Tomcat?
>
> Thanks
> Sarbjit
>
__________________________________________________
Do You Yahoo!?
Make international calls for as low as $.04/minute with Yahoo! Messenger
http://phonecard.yahoo.com/
Re: pre-populate and request scope problem in struts.
Posted by Peter Alfors <pe...@hksystems.com>.
I assume that your select tag is expecting to get data from your form object that you had
previously placed into the request?
When you return to the 'toJsp' page, you will need to place the form object back into the
request, or place the form object in the session in the first place.
When you say that your edit command returns to the previous page, is it going through an
action? If so, you would want to place the form back into the request there
(if you do not want to use the session).
Pete
However, I would suggest that
BinhMinh Nguyen wrote:
> Hi,
> I have the following problem, can anyone help me to
> spot it.
>
> I am using the following technique for pre-populate:
>
> 1- in the Action object of 'fromJSP' , I create an
> objetc of the Form objetc of the 'toJSP'
> 2-I then set all the properties of the Form objetc of
> the 'toJSP' here by calling the setters of this Form
> object. As followed:
>
> Partner partner = new Partner(tradingID,
> fnDataSource);
> //get the product-list from a given partner
> String[] products = partner.getProducts();
>
> //pre=populating
> System.out.println("<RetailerMainAction>-
> Data-Pre-Populating for form processForm");
> ProcessForm processForm = new ProcessForm();
>
> processForm.setProducts(products);
> System.out.println("<RetailerMainAction>- set
> product-collection");
>
> processForm.setTradingID(tradingID);
> System.out.println("<RetailerMainAction>- set
> partner-ID");
>
> request.setAttribute("processForm",processForm);
>
> //the_session.setAttribute("processForm",processForm);
> System.out.println("<RetailerMainAction>- save
> processForm bean");
>
> 3- set the Form object to the request scope.
> request.setAttribute("processForm",processForm);
>
>
> 4- then I give out the 'toJSP'
>
> so far, every works perfectly. All the properies are
> preloaded as expected.
>
> <P>
> <font color="green" size="+2">
> Trading ID <bean:write name="processForm"
> property="tradingID" scope="request"
> />(<%=user_name%>)
> </font>
>
> <hr>
> <table border="0" width="100%">
> <tr><td colspan="2"> </td></tr>
> <tr>
>
> <td align="left" width="10%">
> Product-Line:
> </td>
>
> <td align="left">
> <html:select property="selProduct" size="1" >
> <html:options property="products" />
> </html:select>
>
> </td>
> </tr>
>
> 5- then in the 'toJSP' I issue a command submit to g
> oto the 'lastJSP'. The action forward the request is
> defined in strut-config.xml as below:
>
> <!-- Order -->
> <action path="/main/order/order"
>
> type="com.furnishnet.struts.OrderAction"
> name="orderForm"
> input="/main/order/order_screen.jsp"
> scope="request"
> validate="false">
>
> <forward name="confirm"
> path="/main/order/order_screen.jsp"/>
> <forward name="process_edit"
> path="/main/operation/process_screen.jsp" />
>
>
> </action>
>
> In this 'lastJSP' I have the button "Edit" which
> bring the user back to the previous JSP, 'toJSP'.
> But the serlvet raised an exception. There is
> something wrong with the <select> tag and <option>
> tag,
> if I remove these tag from the JSP, before I
> "come-back" to this 'toJSP', nothing worng happens,
> therefor, there must be something wrong with this
> property and the Form that I save off the attribute
>
> Can some one spot it out for me please.
>
> really appreciate you help
>
> Binh Nguyen
>
>
> __________________________________________________
> Do You Yahoo!?
> Make international calls for as low as $.04/minute with Yahoo! Messenger
> http://phonecard.yahoo.com/
struts and Tomcat 3.3 Beta 1.0 problem
Posted by BinhMinh Nguyen <st...@yahoo.com>.
My application works fine in Tomcat version 3.2.3.
But if this same application is deployed in Tomcat
version 3.3 beta1.0. I got the below error message
when startup the Tomcat Server. I think there is
something worng with the XML Parser API. Do I need a
new XML Parser Version? or How can I fix this problem
thank you
Binh
2001-08-21 14:33:40 - LoadOnStartupInterceptor: cannot
load servlet name: action -
java.lang.NoClassDefFoundError:
org/xml/sax/SAXExceptio
at java.lang.Class.newInstance0(Native Method)
at java.lang.Class.newInstance(Class.java:237)
at
org.apache.tomcat.facade.ServletHandler.getServlet(ServletHandler.java:348)
at
org.apache.tomcat.facade.ServletHandler.preInit(ServletHandler.java:402)
at
org.apache.tomcat.facade.ServletHandler.init(ServletHandler.java:227)
at
org.apache.tomcat.facade.LoadOnStartupInterceptor.contextInit(LoadOnStartupInterceptor.java:136)
at
org.apache.tomcat.core.Context.init(Context.java:501)
at
org.apache.tomcat.core.ContextManager.init(ContextManager.java:588)
at
org.apache.tomcat.startup.EmbededTomcat.initContextManager(EmbededTomcat.java:310)
at
org.apache.tomcat.startup.Tomcat.startTomcat(Tomcat.java:176)
at
org.apache.tomcat.startup.Tomcat.execute(Tomcat.java:120)
at java.lang.reflect.Method.invoke(Native
Method)
at
org.apache.tomcat.util.IntrospectionUtils.execute(IntrospectionUtils.java:87)
at
org.apache.tomcat.startup.Main.execute(Main.java:305)
at org.apache.tomcat.startup.Main.main(Main.java:191)
__________________________________________________
Do You Yahoo!?
Make international calls for as low as $.04/minute with Yahoo! Messenger
http://phonecard.yahoo.com/
pre-populate and request scope problem in struts.
Posted by BinhMinh Nguyen <st...@yahoo.com>.
Hi,
I have the following problem, can anyone help me to
spot it.
I am using the following technique for pre-populate:
1- in the Action object of 'fromJSP' , I create an
objetc of the Form objetc of the 'toJSP'
2-I then set all the properties of the Form objetc of
the 'toJSP' here by calling the setters of this Form
object. As followed:
Partner partner = new Partner(tradingID,
fnDataSource);
//get the product-list from a given partner
String[] products = partner.getProducts();
//pre=populating
System.out.println("<RetailerMainAction>-
Data-Pre-Populating for form processForm");
ProcessForm processForm = new ProcessForm();
processForm.setProducts(products);
System.out.println("<RetailerMainAction>- set
product-collection");
processForm.setTradingID(tradingID);
System.out.println("<RetailerMainAction>- set
partner-ID");
request.setAttribute("processForm",processForm);
//the_session.setAttribute("processForm",processForm);
System.out.println("<RetailerMainAction>- save
processForm bean");
3- set the Form object to the request scope.
request.setAttribute("processForm",processForm);
4- then I give out the 'toJSP'
so far, every works perfectly. All the properies are
preloaded as expected.
<P>
<font color="green" size="+2">
Trading ID <bean:write name="processForm"
property="tradingID" scope="request"
/>(<%=user_name%>)
</font>
<hr>
<table border="0" width="100%">
<tr><td colspan="2"> </td></tr>
<tr>
<td align="left" width="10%">
Product-Line:
</td>
<td align="left">
<html:select property="selProduct" size="1" >
<html:options property="products" />
</html:select>
</td>
</tr>
5- then in the 'toJSP' I issue a command submit to g
oto the 'lastJSP'. The action forward the request is
defined in strut-config.xml as below:
<!-- Order -->
<action path="/main/order/order"
type="com.furnishnet.struts.OrderAction"
name="orderForm"
input="/main/order/order_screen.jsp"
scope="request"
validate="false">
<forward name="confirm"
path="/main/order/order_screen.jsp"/>
<forward name="process_edit"
path="/main/operation/process_screen.jsp" />
</action>
In this 'lastJSP' I have the button "Edit" which
bring the user back to the previous JSP, 'toJSP'.
But the serlvet raised an exception. There is
something wrong with the <select> tag and <option>
tag,
if I remove these tag from the JSP, before I
"come-back" to this 'toJSP', nothing worng happens,
therefor, there must be something wrong with this
property and the Form that I save off the attribute
Can some one spot it out for me please.
really appreciate you help
Binh Nguyen
__________________________________________________
Do You Yahoo!?
Make international calls for as low as $.04/minute with Yahoo! Messenger
http://phonecard.yahoo.com/
Re: Strtus 1.0 and Tomcat 4.0
Posted by "Craig R. McClanahan" <cr...@apache.org>.
On Tue, 21 Aug 2001, Sarbjit Singh wrote:
> Hi, does Stutrs 1.0 work at all with Tomcat 4.0?
Sure ... since I'm the primary developer of both Struts and Tomcat 4.0,
you can count on that!
In fact, Tomcat 4 should run *any* web app based on the Servlet 2.2 and
JSP 1.1 specs just fine. Backwards compatibility is required by the new
Servlet 2.3 and JSP 1.2 specs that Tomcat 4.0 supports.
> Is there a 1.1 version of struts that may work with it?
> Where can i find infor about working Struts 1.0 - 1.1 with Tomcat 4.0
>
The only thing you need to do is make sure an XML parser is visible to
your webapps -- either copy the JAXP jar files (or Xerces) into
$CATALINA_HOME/lib, or into your web app's /WEB-INF/lib, and you're all
set.
> Also, has anyone tried Struts with Sun Fote's interal Tomcat?
>
> Thanks
> Sarbjit
>
>
Craig
Strtus 1.0 and Tomcat 4.0
Posted by Sarbjit Singh <si...@hotmail.com>.
Hi, does Stutrs 1.0 work at all with Tomcat 4.0?
Is there a 1.1 version of struts that may work with it?
Where can i find infor about working Struts 1.0 - 1.1 with Tomcat 4.0
Also, has anyone tried Struts with Sun Fote's interal Tomcat?
Thanks
Sarbjit