RE: Transmission of a session using jsessionID

2004-12-11 Thread Vadim Petrenko
Congrats then.

More generic way: 
Authentication webapp authenticates the user, obtains it's data, like name,
age, all parameters you were talking about, then saves them in the database,
in a row with a primary key which == id of the session of the authentication
webapp. Then it redirects to the main webapp with a parameter, say, "authId"
== value of that primary key. The main webapp reads data from the db and can
use it for further processing. Then deletes that row from the table. If it
can't find a row with provided id, then it logs the user as a possible
hacker :)

Vadim.


-Original Message-
From: Claude Libois [mailto:[EMAIL PROTECTED] 
Sent: Thursday, December 09, 2004 10:58 AM
To: Struts Users Mailing List
Subject: Re: Transmission of a session using jsessionID

Unfortunately we are working with weblogic 8.1...
However now it seems to work but I don't know why :)
I just make the https redirection into the pre-processor and now the session
seems to be kept...
Claude Libois
[EMAIL PROTECTED]
Technical associate - Unisys

- Original Message - 
From: "Niall Pemberton" <[EMAIL PROTECTED]>
To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
Sent: Thursday, December 09, 2004 10:54 AM
Subject: Re: Transmission of a session using jsessionID


> Maybe this "Tomcat How To" will help...
>
> http://www.fwd.at/tomcat/sharing-session-data-howto.html
>
> Niall
>
> - Original Message - 
> From: "Claude Libois" <[EMAIL PROTECTED]>
> To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
> Sent: Thursday, December 09, 2004 8:59 AM
> Subject: Re: Transmission of a session using jsessionID
>
>
> > A precision that make a big difference.
> > The two actions are not in the same web application.
> > I saw on a forum that sharing session between two web app is "bad
design"
> > and so is not allow with jsessionID.
> > Is it true? If so, is there any other way to share session between two
> > different web application. I really need to do this...
> > Claude Libois
> > [EMAIL PROTECTED]
> > Technical associate - Unisys
> >
> > - Original Message - 
> > From: "Claude Libois" <[EMAIL PROTECTED]>
> > To: <[EMAIL PROTECTED]>
> > Sent: Thursday, December 09, 2004 9:32 AM
> > Subject: Transmission of a session using jsessionID
> >
> >
> > > Hi all,
> > > I try to keep my session after a redirect in struts but it doesn't
work.
> > So
> > > I made a test application with an action sendSession.do and an other
> > action
> > > receiveSession.do.
> > > Here are the code of those two simple action:
> > > 
> > > sendSession.do
> > > 
> > > public class sendSession extends Action {
> > > public ActionForward execute(ActionMapping actionMapping,
> > >  ActionForm actionForm,
> > >  HttpServletRequest servletRequest,
> > >  HttpServletResponse servletResponse)
{
> > > System.out.println("* sessionId before
redirect"
> > > +servletRequest.getSession().getId());
> > > servletRequest.getSession().setAttribute("test","test");
> > > ActionForward af=new ActionForward(
> > >
> > "http://12.2.33.13:4/Consumer/receiveSession.do;jsessionid=";
> > > +
> > > servletRequest.getSession().getId(),true);
> > > return af;
> > > }
> > > }
> > > *
> > > receiveSession.do
> > > *
> > > public class ReceiveSession extends Action {
> > > public ActionForward execute(ActionMapping actionMapping,
> > >  ActionForm actionForm,
> > >  HttpServletRequest servletRequest,
> > >  HttpServletResponse servletResponse)
{
> > >  System.out.println("* sessionId after redirect"
> > > +servletRequest.getSession().getId());
> > > System.out.println("test
> > > "+servletRequest.getSession().getAttribute("test"));
> > > return null;
> > >  }
> > > }
> > >
> > > What's wrong with it? the attribute "test" is null in
receiveSession.do
> > > Is there anything else to do for session sharing between two web app??
> > >
> > > Thanks in advance
> > >
> > > Claude Libois
> > > [EMAIL PROTECTED]
> > > Technical associate - Unisys
> > >
> > >
> > > -
> > > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > > For additional commands, e-mail: [EMAIL PROTECTED]
> > >
> >
> >
> > -
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> >
> >
> >
>
>
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAI

RE: Nested Struts Tags

2004-12-11 Thread Vadim Petrenko
That means that dataStewardId in your form isn't a String, to circumvent the
compilation error you can use the following construction:

value="<%= test.toString() %>"

Vadim.

-Original Message-
From: Lee Harrington [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, December 08, 2004 10:48 PM
To: Struts Users Mailing List
Subject: Re: Nested Struts Tags








This code produced the following error:

[ServletException in:/form/MetricDisplayViewOnly.jsp] Unable to
compile class for JSP An error occurred at line: 54 in the jsp file:
/form/MetricDisplayViewOnly.jsp Generated servlet error: [javac]
Compiling 1 source file
C:\tomcat5\work\Catalina\localhost\dd3\org\apache\jsp\form\MetricDisplayView
Only_jsp.java:174:
cannot resolve symbol symbol : method setValue (java.lang.Object)
location: class org.apache.struts.taglib.logic.EqualTag
_jspx_th_logic_equal_0.setValue( test ); ^ 1 error '


On Wed, 8 Dec 2004 22:25:47 +0100, Vadim Petrenko <[EMAIL PROTECTED]> wrote:
> Hi, Lee,
> 
> Did you try ?
> 
> 
> 
> 
> 
> 
> 
> 
> Vadim.
> 
> 
> 
> -Original Message-
> From: Lee Harrington [mailto:[EMAIL PROTECTED]
> Sent: Wednesday, December 08, 2004 10:07 PM
> To: [EMAIL PROTECTED]
> Subject: Nested Struts Tags
> 
> I'm in a conundrum.  I have a page that normally displays a pick list.
>  Sometimes, though, I don't want folks to editso I just display
> the values.
> 
> But for picklists, I don't want to display the value, but what the
> pick list resolves to.  I already have the "list" the picklist uses in
> the request scope...so I try the following:
> 
> 
> 
> 
> 
> 
> 
> It works if I hard code the value (the 9 on the second line)
> 
> What I want is the form value.  I've tried lots of things.  None work:
> 
>   - value=""
>   - value="<%= dataStewardId %>"
>   - value="<%= metricForm.dataStewardId %>"
>   - value="<%= metricForm.get('dataStewardId') %>"
> 
> etc.
> 
> I either need to be able to nest the "" tag, or I
> need to get a java script handle on the form variable to use in "<%=
> =>".
> 
> I'm stuck,
> 
> Lee
> 
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
>

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: LookupDispatchAction issue

2004-12-10 Thread Vadim Petrenko
I would suggest not doing it like that, define a hidden property instead,
otherwise one day when you decide to debug your page and add method="get" to
the form tag (attribute, not parameter) you'd be surprised that it doesn't
work.

  


Also with this construction you can quite elegantly add an onclick event to
your submit buttons which would set value of "method" to the value related
to the clicked button.


-Original Message-
From: andy wix [mailto:[EMAIL PROTECTED] 
Sent: Friday, December 10, 2004 2:56 PM
To: [EMAIL PROTECTED]
Subject: RE: LookupDispatchAction issue

Hi,

This is now fixed.  It was because I didn't have a 'default' method 
specified in the form tag. I.e.,

  

Regards,
andy

_
It's fast, it's easy and it's free. Get MSN Messenger today! 
http://www.msn.co.uk/messenger


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: An Other "Blank Page" issue

2004-12-09 Thread Vadim Petrenko
Hi, 

can you manually invoke your Login action, directly from the browser, like
http://localhost:8080/test/Login.do  ???



-Original Message-
From: Sylvain ~ [mailto:[EMAIL PROTECTED] 
Sent: Thursday, December 09, 2004 2:21 PM
To: [EMAIL PROTECTED]
Subject: An Other "Blank Page" issue

Hi,

I'm quite new to struts, and I'm trying to make a simple example taken
from a website.
The first page show a formular, and when submited it is automatically
forwarded to an other page.

the problem is that when I submit, I get an absolute blank page, the
source is "".

I checked Tomcat logs, and There is nothing wrong, the only thing is
that I'm sure is that the Action (in my case LoginAction) is not
performed because it produces a stdout output.

See attached files for details about code



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: Transmission of a session using jsessionID

2004-12-09 Thread Vadim Petrenko
Or something like:
Authentication webapp authenticates the user, obtains it's data, like name,
age, all parameters you were talking about, then saves them in the database,
in a row with a primary key which == id of the session of the authentication
webapp. Then it redirects to the main webapp with a parameter, say, "authId"
== value of that primary key. The main webapp reads data from the db and can
use it for further processing. Then deletes that row from the table. If it
can't find a row with provided id, then it logs the user as a possible
hacker :)


-Original Message-
From: John McCosker [mailto:[EMAIL PROTECTED] 
Sent: Thursday, December 09, 2004 11:07 AM
To: 'Struts Users Mailing List'
Subject: RE: Transmission of a session using jsessionID

>>is there any other way to share session between two
>> different web application. I really need to do this...

Just my 2 cents,
which ever application creates the session, you could create a unique
indentifier,
store it in a dsn, then write indentifier to url for all inetractions with
applications and verify with
dsn lookup. This may not be the most intuitive approach, maybe, depends if
both
apps have access to dsn. You also would want to do a dsn cleanup for expired
indentifier's.

Or have application dependant sessions verfied by value of url
or hidden form field so its not actually seen, and cut out the dsn
altogether.

-Original Message-
From: Niall Pemberton [mailto:[EMAIL PROTECTED]
Sent: 09 December 2004 09:54
To: Struts Users Mailing List
Subject: Re: Transmission of a session using jsessionID


Maybe this "Tomcat How To" will help...

http://www.fwd.at/tomcat/sharing-session-data-howto.html

Niall

- Original Message - 
From: "Claude Libois" <[EMAIL PROTECTED]>
To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
Sent: Thursday, December 09, 2004 8:59 AM
Subject: Re: Transmission of a session using jsessionID


> A precision that make a big difference.
> The two actions are not in the same web application.
> I saw on a forum that sharing session between two web app is "bad design"
> and so is not allow with jsessionID.
> Is it true? If so, is there any other way to share session between two
> different web application. I really need to do this...
> Claude Libois
> [EMAIL PROTECTED]
> Technical associate - Unisys
>
> - Original Message - 
> From: "Claude Libois" <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>
> Sent: Thursday, December 09, 2004 9:32 AM
> Subject: Transmission of a session using jsessionID
>
>
> > Hi all,
> > I try to keep my session after a redirect in struts but it doesn't work.
> So
> > I made a test application with an action sendSession.do and an other
> action
> > receiveSession.do.
> > Here are the code of those two simple action:
> > 
> > sendSession.do
> > 
> > public class sendSession extends Action {
> > public ActionForward execute(ActionMapping actionMapping,
> >  ActionForm actionForm,
> >  HttpServletRequest servletRequest,
> >  HttpServletResponse servletResponse) {
> > System.out.println("* sessionId before redirect"
> > +servletRequest.getSession().getId());
> > servletRequest.getSession().setAttribute("test","test");
> > ActionForward af=new ActionForward(
> >
> "http://12.2.33.13:4/Consumer/receiveSession.do;jsessionid=";
> > +
> > servletRequest.getSession().getId(),true);
> > return af;
> > }
> > }
> > *
> > receiveSession.do
> > *
> > public class ReceiveSession extends Action {
> > public ActionForward execute(ActionMapping actionMapping,
> >  ActionForm actionForm,
> >  HttpServletRequest servletRequest,
> >  HttpServletResponse servletResponse) {
> >  System.out.println("* sessionId after redirect"
> > +servletRequest.getSession().getId());
> > System.out.println("test
> > "+servletRequest.getSession().getAttribute("test"));
> > return null;
> >  }
> > }
> >
> > What's wrong with it? the attribute "test" is null in receiveSession.do
> > Is there anything else to do for session sharing between two web app??
> >
> > Thanks in advance
> >
> > Claude Libois
> > [EMAIL PROTECTED]
> > Technical associate - Unisys
> >
> >
> > -
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> >
>
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>
>



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



-

RE: Transmission of a session using jsessionID

2004-12-09 Thread Vadim Petrenko
I agree, that sharing a session between 2 separate webapps is an example of
a horrible design. One is not supposed to manipulate with jsessionid
directly. 

However, if you don't need to share _entire_ session, but only several
attributes, then you can use database to share them or take advantage of
JNDI.

If you still want to share entire session, can you explain why you want to
do that? Maybe there are different approaches?

Vadim.

-Original Message-
From: Claude Libois [mailto:[EMAIL PROTECTED] 
Sent: Thursday, December 09, 2004 9:59 AM
To: Struts Users Mailing List
Subject: Re: Transmission of a session using jsessionID

A precision that make a big difference.
The two actions are not in the same web application.
I saw on a forum that sharing session between two web app is "bad design"
and so is not allow with jsessionID.
Is it true? If so, is there any other way to share session between two
different web application. I really need to do this...
Claude Libois
[EMAIL PROTECTED]
Technical associate - Unisys

- Original Message - 
From: "Claude Libois" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Thursday, December 09, 2004 9:32 AM
Subject: Transmission of a session using jsessionID


> Hi all,
> I try to keep my session after a redirect in struts but it doesn't work.
So
> I made a test application with an action sendSession.do and an other
action
> receiveSession.do.
> Here are the code of those two simple action:
> 
> sendSession.do
> 
> public class sendSession extends Action {
> public ActionForward execute(ActionMapping actionMapping,
>  ActionForm actionForm,
>  HttpServletRequest servletRequest,
>  HttpServletResponse servletResponse) {
> System.out.println("* sessionId before redirect"
> +servletRequest.getSession().getId());
> servletRequest.getSession().setAttribute("test","test");
> ActionForward af=new ActionForward(
>
"http://12.2.33.13:4/Consumer/receiveSession.do;jsessionid=";
> +
> servletRequest.getSession().getId(),true);
> return af;
> }
> }
> *
> receiveSession.do
> *
> public class ReceiveSession extends Action {
> public ActionForward execute(ActionMapping actionMapping,
>  ActionForm actionForm,
>  HttpServletRequest servletRequest,
>  HttpServletResponse servletResponse) {
>  System.out.println("* sessionId after redirect"
> +servletRequest.getSession().getId());
> System.out.println("test
> "+servletRequest.getSession().getAttribute("test"));
> return null;
>  }
> }
>
> What's wrong with it? the attribute "test" is null in receiveSession.do
> Is there anything else to do for session sharing between two web app??
>
> Thanks in advance
>
> Claude Libois
> [EMAIL PROTECTED]
> Technical associate - Unisys
>
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: Transmission of a session using jsessionID

2004-12-09 Thread Vadim Petrenko
Claude,

Try this one: 

ActionForward af=new ActionForward(response.encodeRedirectURL(
"http://12.2.33.13:4/Consumer/receiveSession.do";),true);

It's gonna add jsessionid as well, if necessary, see
http://java.sun.com/j2ee/1.4/docs/api/javax/servlet/http/HttpServletResponse
.html#encodeRedirectURL(java.lang.String)

However, strange if Struts isn't doing this already...

Vadim.

-Original Message-
From: Claude Libois [mailto:[EMAIL PROTECTED] 
Sent: Thursday, December 09, 2004 9:32 AM
To: [EMAIL PROTECTED]
Subject: Transmission of a session using jsessionID

Hi all,
I try to keep my session after a redirect in struts but it doesn't work. So
I made a test application with an action sendSession.do and an other action
receiveSession.do.
Here are the code of those two simple action:

sendSession.do

public class sendSession extends Action {
public ActionForward execute(ActionMapping actionMapping,
 ActionForm actionForm,
 HttpServletRequest servletRequest,
 HttpServletResponse servletResponse) {
System.out.println("* sessionId before redirect"
+servletRequest.getSession().getId());
servletRequest.getSession().setAttribute("test","test");
ActionForward af=new ActionForward(
"http://12.2.33.13:4/Consumer/receiveSession.do;jsessionid=";
+
servletRequest.getSession().getId(),true);
return af;
}
}
*
receiveSession.do
*
public class ReceiveSession extends Action {
public ActionForward execute(ActionMapping actionMapping,
 ActionForm actionForm,
 HttpServletRequest servletRequest,
 HttpServletResponse servletResponse) {
 System.out.println("* sessionId after redirect"
+servletRequest.getSession().getId());
System.out.println("test
"+servletRequest.getSession().getAttribute("test"));
return null;
 }
}

What's wrong with it? the attribute "test" is null in receiveSession.do
Is there anything else to do for session sharing between two web app??

Thanks in advance

Claude Libois
[EMAIL PROTECTED]
Technical associate - Unisys


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: Nested Struts Tags

2004-12-08 Thread Vadim Petrenko
Hi, Lee,

Did you try ?



  




Vadim.

-Original Message-
From: Lee Harrington [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, December 08, 2004 10:07 PM
To: [EMAIL PROTECTED]
Subject: Nested Struts Tags

I'm in a conundrum.  I have a page that normally displays a pick list.
 Sometimes, though, I don't want folks to editso I just display
the values.

But for picklists, I don't want to display the value, but what the
pick list resolves to.  I already have the "list" the picklist uses in
the request scope...so I try the following:


  




It works if I hard code the value (the 9 on the second line)

What I want is the form value.  I've tried lots of things.  None work:

  - value=""
  - value="<%= dataStewardId %>"
  - value="<%= metricForm.dataStewardId %>"
  - value="<%= metricForm.get('dataStewardId') %>"

etc.

I either need to be able to nest the "" tag, or I
need to get a java script handle on the form variable to use in "<%=
=>".

I'm stuck,

Lee

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]