RE: Transmission of a session using jsessionID
FWIW: I had a similar situation and used cookies to pass encrypted values between the web apps. I also used a filter to check for changes in those cookie values and to put the values from the cookie into the correct web app session. -Jerry Rodgers -Original Message- From: Vadim Petrenko [mailto:[EMAIL PROTECTED] Sent: Thursday, December 09, 2004 2:37 AM To: 'Struts Users Mailing List' Subject: RE: Transmission of a session using jsessionID 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(&quo
RE: Transmission of a session using jsessionID
FWIW: I had a similar situation and used cookies to pass encrypted values between the web apps. I also used a filter to check for changes in those cookie values and to put the values from the cookie into the correct web app session. -Jerry Rodgers -Original Message- From: Vadim Petrenko [mailto:[EMAIL PROTECTED] Sent: Thursday, December 09, 2004 2:37 AM To: 'Struts Users Mailing List' Subject: RE: Transmission of a session using jsessionID 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(&quo
RE: JSTL, Tiles PutList and Tomcat 5.028
If I understand your question - "do I have a collection of collections" no I don't - I have a collection of SimpleMenuItem(s) the SimpleMenuItem is not a collection it is just an object with four properties. It is a org.apache.struts.tiles.beans.SimpleMenuItem Back to the original jsp code - it appears to be pretty vanilla. The tiles tag adds the topnav collection to the pagecontext. -Jerry -Original Message- From: Jim Barrows [mailto:[EMAIL PROTECTED] Sent: Friday, December 03, 2004 9:08 AM To: Struts Users Mailing List Subject: RE: JSTL, Tiles PutList and Tomcat 5.028 > -Original Message----- > From: Jerry Rodgers [mailto:[EMAIL PROTECTED] > Sent: Friday, December 03, 2004 9:55 AM > To: 'Struts Users Mailing List' > Subject: RE: JSTL, Tiles PutList and Tomcat 5.028 > > > Thanks James, > > It looks like if I put a break point in the setItems() method > of the forEach > I am passed a string - that string appears to be the > .toString() of the > SimpleMenuItem(s) collection. > > I check the .toString() of SimpleMenuItem and it has the > format of the long > string below from my previous message - i.e. the 5 or so items in the > collection. > > How does / or should the ForEach turn that string back into a > collection of > items. If I understand what you're saying You have something like: Collection foo; Collection bar; bar.add(foo); then something like foo[i][j] MIGHT work. On the other hand ifyou have just a collletion fo foo.. you want foo[i]. > > When looking at the parameter on the method signature I had > expected that I > would get the "EXPRESSION" that needed to be evaluated by > jstl within the > tag instead it appears the expression has been run prior to > the call of the > method an then the .toString() has been called. > > Thanks for everyone's help and input on this - I have now > spent two/three > very late nights tracking this down. > > -Jerry > > > > > -Original Message- > From: Jim Barrows [mailto:[EMAIL PROTECTED] > Sent: Friday, December 03, 2004 8:45 AM > To: Struts Users Mailing List > Subject: RE: JSTL, Tiles PutList and Tomcat 5.028 > > > > > -Original Message- > > From: Jerry Rodgers [mailto:[EMAIL PROTECTED] > > Sent: Friday, December 03, 2004 9:20 AM > > To: 'Struts Users Mailing List'; 'Mark Lowe' > > Subject: RE: JSTL, Tiles PutList and Tomcat 5.028 > > > > > > One other thing to add :> there is a "key" in the pageContext > > attributes > > called topnav and that DOES contain an actual collection of > > SimpleMenuItems. > > The plot thickens - how does the ForEach get the collection? > > I think it looks up the scope chain request, session, application > > > > > -Jerry > > > > -Original Message- > > From: Jerry Rodgers [mailto:[EMAIL PROTECTED] > > Sent: Friday, December 03, 2004 8:02 AM > > To: 'Struts Users Mailing List'; 'Mark Lowe' > > Subject: RE: JSTL, Tiles PutList and Tomcat 5.028 > > > > Hi Matk, > > > > I have the following statement > > > > > > > > Which I "think" am lead to believe it imports all the > > attributes into the > > page scope. > > > > In an effort to figure out what was happening I downloaded > > the jstl 1.0.6 > > and built a debug project in eclipse so I could step into the > > ForEach tag > > and I am not sure what I am really looking at yet in there > > but it appears > > that indeed the item does contain a string and that the items > > collection on > > the tag has a "somewhat" string delimited representation of > > the collection. > > > > See below: This is that actual value in the string in the > > debugger... Is > > this how it is stored then is ir "reconstituted" into > > SimpleMenuItem(s) as > > the tag loops. The string "looks" like a collection because > > of the "," i.e. > > it looks like a string tokenizer. > > > > [SimpleMenuItem[value=nav.adminhome, > > link=/aems/session/changefiltertoken.do?btnResetFilter=true, > > tooltip=impersonationItem, ], SimpleMenuItem[value=nav.account, > > link=/aems/party/persondetail.do, ], > > SimpleMenuItem[value=nav.organization, > > link=/aems/party/organizationdetail.do, ], > > SimpleMenuItem[value=nav.library, > > link=/aems/file/filelibrarylist.do, ], > > SimpleMenuItem[value=nav.addressbook, > > link=/aems/communi
RE: JSTL, Tiles PutList and Tomcat 5.028
If I understand your question - "do I have a collection of collections" no I don't - I have a collection of SimpleMenuItem(s) the SimpleMenuItem is not a collection it is just an object with four properties. It is a org.apache.struts.tiles.beans.SimpleMenuItem Back to the original jsp code - it appears to be pretty vanilla. The tiles tag adds the topnav collection to the pagecontext. -Jerry -Original Message- From: Jim Barrows [mailto:[EMAIL PROTECTED] Sent: Friday, December 03, 2004 9:08 AM To: Struts Users Mailing List Subject: RE: JSTL, Tiles PutList and Tomcat 5.028 > -Original Message----- > From: Jerry Rodgers [mailto:[EMAIL PROTECTED] > Sent: Friday, December 03, 2004 9:55 AM > To: 'Struts Users Mailing List' > Subject: RE: JSTL, Tiles PutList and Tomcat 5.028 > > > Thanks James, > > It looks like if I put a break point in the setItems() method > of the forEach > I am passed a string - that string appears to be the > .toString() of the > SimpleMenuItem(s) collection. > > I check the .toString() of SimpleMenuItem and it has the > format of the long > string below from my previous message - i.e. the 5 or so items in the > collection. > > How does / or should the ForEach turn that string back into a > collection of > items. If I understand what you're saying You have something like: Collection foo; Collection bar; bar.add(foo); then something like foo[i][j] MIGHT work. On the other hand ifyou have just a collletion fo foo.. you want foo[i]. > > When looking at the parameter on the method signature I had > expected that I > would get the "EXPRESSION" that needed to be evaluated by > jstl within the > tag instead it appears the expression has been run prior to > the call of the > method an then the .toString() has been called. > > Thanks for everyone's help and input on this - I have now > spent two/three > very late nights tracking this down. > > -Jerry > > > > > -Original Message- > From: Jim Barrows [mailto:[EMAIL PROTECTED] > Sent: Friday, December 03, 2004 8:45 AM > To: Struts Users Mailing List > Subject: RE: JSTL, Tiles PutList and Tomcat 5.028 > > > > > -Original Message- > > From: Jerry Rodgers [mailto:[EMAIL PROTECTED] > > Sent: Friday, December 03, 2004 9:20 AM > > To: 'Struts Users Mailing List'; 'Mark Lowe' > > Subject: RE: JSTL, Tiles PutList and Tomcat 5.028 > > > > > > One other thing to add :> there is a "key" in the pageContext > > attributes > > called topnav and that DOES contain an actual collection of > > SimpleMenuItems. > > The plot thickens - how does the ForEach get the collection? > > I think it looks up the scope chain request, session, application > > > > > -Jerry > > > > -Original Message- > > From: Jerry Rodgers [mailto:[EMAIL PROTECTED] > > Sent: Friday, December 03, 2004 8:02 AM > > To: 'Struts Users Mailing List'; 'Mark Lowe' > > Subject: RE: JSTL, Tiles PutList and Tomcat 5.028 > > > > Hi Matk, > > > > I have the following statement > > > > > > > > Which I "think" am lead to believe it imports all the > > attributes into the > > page scope. > > > > In an effort to figure out what was happening I downloaded > > the jstl 1.0.6 > > and built a debug project in eclipse so I could step into the > > ForEach tag > > and I am not sure what I am really looking at yet in there > > but it appears > > that indeed the item does contain a string and that the items > > collection on > > the tag has a "somewhat" string delimited representation of > > the collection. > > > > See below: This is that actual value in the string in the > > debugger... Is > > this how it is stored then is ir "reconstituted" into > > SimpleMenuItem(s) as > > the tag loops. The string "looks" like a collection because > > of the "," i.e. > > it looks like a string tokenizer. > > > > [SimpleMenuItem[value=nav.adminhome, > > link=/aems/session/changefiltertoken.do?btnResetFilter=true, > > tooltip=impersonationItem, ], SimpleMenuItem[value=nav.account, > > link=/aems/party/persondetail.do, ], > > SimpleMenuItem[value=nav.organization, > > link=/aems/party/organizationdetail.do, ], > > SimpleMenuItem[value=nav.library, > > link=/aems/file/filelibrarylist.do, ], > > SimpleMenuItem[value=nav.addressbook, > > link=/aems/communi
RE: JSTL, Tiles PutList and Tomcat 5.028
Thanks James, It looks like if I put a break point in the setItems() method of the forEach I am passed a string - that string appears to be the .toString() of the SimpleMenuItem(s) collection. I check the .toString() of SimpleMenuItem and it has the format of the long string below from my previous message - i.e. the 5 or so items in the collection. How does / or should the ForEach turn that string back into a collection of items. When looking at the parameter on the method signature I had expected that I would get the "EXPRESSION" that needed to be evaluated by jstl within the tag instead it appears the expression has been run prior to the call of the method an then the .toString() has been called. Thanks for everyone's help and input on this - I have now spent two/three very late nights tracking this down. -Jerry -Original Message- From: Jim Barrows [mailto:[EMAIL PROTECTED] Sent: Friday, December 03, 2004 8:45 AM To: Struts Users Mailing List Subject: RE: JSTL, Tiles PutList and Tomcat 5.028 > -Original Message----- > From: Jerry Rodgers [mailto:[EMAIL PROTECTED] > Sent: Friday, December 03, 2004 9:20 AM > To: 'Struts Users Mailing List'; 'Mark Lowe' > Subject: RE: JSTL, Tiles PutList and Tomcat 5.028 > > > One other thing to add :> there is a "key" in the pageContext > attributes > called topnav and that DOES contain an actual collection of > SimpleMenuItems. > The plot thickens - how does the ForEach get the collection? I think it looks up the scope chain request, session, application > > -Jerry > > -Original Message- > From: Jerry Rodgers [mailto:[EMAIL PROTECTED] > Sent: Friday, December 03, 2004 8:02 AM > To: 'Struts Users Mailing List'; 'Mark Lowe' > Subject: RE: JSTL, Tiles PutList and Tomcat 5.028 > > Hi Matk, > > I have the following statement > > > > Which I "think" am lead to believe it imports all the > attributes into the > page scope. > > In an effort to figure out what was happening I downloaded > the jstl 1.0.6 > and built a debug project in eclipse so I could step into the > ForEach tag > and I am not sure what I am really looking at yet in there > but it appears > that indeed the item does contain a string and that the items > collection on > the tag has a "somewhat" string delimited representation of > the collection. > > See below: This is that actual value in the string in the > debugger... Is > this how it is stored then is ir "reconstituted" into > SimpleMenuItem(s) as > the tag loops. The string "looks" like a collection because > of the "," i.e. > it looks like a string tokenizer. > > [SimpleMenuItem[value=nav.adminhome, > link=/aems/session/changefiltertoken.do?btnResetFilter=true, > tooltip=impersonationItem, ], SimpleMenuItem[value=nav.account, > link=/aems/party/persondetail.do, ], > SimpleMenuItem[value=nav.organization, > link=/aems/party/organizationdetail.do, ], > SimpleMenuItem[value=nav.library, > link=/aems/file/filelibrarylist.do, ], > SimpleMenuItem[value=nav.addressbook, > link=/aems/communication/personsearchlist.do, ], > SimpleMenuItem[value=nav.help, link=#, tooltip=help, ], > SimpleMenuItem[value=nav.logout, link=/aems/logout.do, ]] > > And give this sting in the items - the actual when call to > next() within the > EnumeratonAdapter way in the ForEachSupport class actuall calls the > StringTokenizer and returns an item of: > > [SimpleMenuItem[value=nav.adminhome > > So it looks like it went to the first "," and thus the > subject of my email > might really be changed to: "What is causing ForEach to > read/load my tiles > putlist collection as a string and not as a collection of the > SimpleMenuItems they really are"? Pretty darn long subject :> > > > On a side note - not sure if this means anything - when I compiled the > course I was required by eclipse to add two new methods to the > PageContextImpl in the > org.apache.taglibs.standard.lang.jstl.test package > does it looks like perhaps the different JSP version might be > an issue. i.e. > will jstl 1.0.6 work in Tomcat 5.0.28? > > > /* (non-Javadoc) > * @see javax.servlet.jsp.JspContext#getExpressionEvaluator() > */ > public ExpressionEvaluator getExpressionEvaluator() { > // TODO Auto-generated method stub > return null; > } > > /* (non-Javadoc) > * @see javax.servlet.jsp.JspContext#getVariableResolver() > */ > public VariableResolver getVariableResolver() { > // TODO Auto-generated method stub > return null; > } > > > Thanks, &g
RE: JSTL, Tiles PutList and Tomcat 5.028
Thanks James, It looks like if I put a break point in the setItems() method of the forEach I am passed a string - that string appears to be the .toString() of the SimpleMenuItem(s) collection. I check the .toString() of SimpleMenuItem and it has the format of the long string below from my previous message - i.e. the 5 or so items in the collection. How does / or should the ForEach turn that string back into a collection of items. When looking at the parameter on the method signature I had expected that I would get the "EXPRESSION" that needed to be evaluated by jstl within the tag instead it appears the expression has been run prior to the call of the method an then the .toString() has been called. Thanks for everyone's help and input on this - I have now spent two/three very late nights tracking this down. -Jerry -Original Message- From: Jim Barrows [mailto:[EMAIL PROTECTED] Sent: Friday, December 03, 2004 8:45 AM To: Struts Users Mailing List Subject: RE: JSTL, Tiles PutList and Tomcat 5.028 > -Original Message----- > From: Jerry Rodgers [mailto:[EMAIL PROTECTED] > Sent: Friday, December 03, 2004 9:20 AM > To: 'Struts Users Mailing List'; 'Mark Lowe' > Subject: RE: JSTL, Tiles PutList and Tomcat 5.028 > > > One other thing to add :> there is a "key" in the pageContext > attributes > called topnav and that DOES contain an actual collection of > SimpleMenuItems. > The plot thickens - how does the ForEach get the collection? I think it looks up the scope chain request, session, application > > -Jerry > > -Original Message- > From: Jerry Rodgers [mailto:[EMAIL PROTECTED] > Sent: Friday, December 03, 2004 8:02 AM > To: 'Struts Users Mailing List'; 'Mark Lowe' > Subject: RE: JSTL, Tiles PutList and Tomcat 5.028 > > Hi Matk, > > I have the following statement > > > > Which I "think" am lead to believe it imports all the > attributes into the > page scope. > > In an effort to figure out what was happening I downloaded > the jstl 1.0.6 > and built a debug project in eclipse so I could step into the > ForEach tag > and I am not sure what I am really looking at yet in there > but it appears > that indeed the item does contain a string and that the items > collection on > the tag has a "somewhat" string delimited representation of > the collection. > > See below: This is that actual value in the string in the > debugger... Is > this how it is stored then is ir "reconstituted" into > SimpleMenuItem(s) as > the tag loops. The string "looks" like a collection because > of the "," i.e. > it looks like a string tokenizer. > > [SimpleMenuItem[value=nav.adminhome, > link=/aems/session/changefiltertoken.do?btnResetFilter=true, > tooltip=impersonationItem, ], SimpleMenuItem[value=nav.account, > link=/aems/party/persondetail.do, ], > SimpleMenuItem[value=nav.organization, > link=/aems/party/organizationdetail.do, ], > SimpleMenuItem[value=nav.library, > link=/aems/file/filelibrarylist.do, ], > SimpleMenuItem[value=nav.addressbook, > link=/aems/communication/personsearchlist.do, ], > SimpleMenuItem[value=nav.help, link=#, tooltip=help, ], > SimpleMenuItem[value=nav.logout, link=/aems/logout.do, ]] > > And give this sting in the items - the actual when call to > next() within the > EnumeratonAdapter way in the ForEachSupport class actuall calls the > StringTokenizer and returns an item of: > > [SimpleMenuItem[value=nav.adminhome > > So it looks like it went to the first "," and thus the > subject of my email > might really be changed to: "What is causing ForEach to > read/load my tiles > putlist collection as a string and not as a collection of the > SimpleMenuItems they really are"? Pretty darn long subject :> > > > On a side note - not sure if this means anything - when I compiled the > course I was required by eclipse to add two new methods to the > PageContextImpl in the > org.apache.taglibs.standard.lang.jstl.test package > does it looks like perhaps the different JSP version might be > an issue. i.e. > will jstl 1.0.6 work in Tomcat 5.0.28? > > > /* (non-Javadoc) > * @see javax.servlet.jsp.JspContext#getExpressionEvaluator() > */ > public ExpressionEvaluator getExpressionEvaluator() { > // TODO Auto-generated method stub > return null; > } > > /* (non-Javadoc) > * @see javax.servlet.jsp.JspContext#getVariableResolver() > */ > public VariableResolver getVariableResolver() { > // TODO Auto-generated method stub > return null; > } > > > Thanks, &g
RE: JSTL, Tiles PutList and Tomcat 5.028
One other thing to add :> there is a "key" in the pageContext attributes called topnav and that DOES contain an actual collection of SimpleMenuItems. The plot thickens - how does the ForEach get the collection? -Jerry -Original Message- From: Jerry Rodgers [mailto:[EMAIL PROTECTED] Sent: Friday, December 03, 2004 8:02 AM To: 'Struts Users Mailing List'; 'Mark Lowe' Subject: RE: JSTL, Tiles PutList and Tomcat 5.028 Hi Matk, I have the following statement Which I "think" am lead to believe it imports all the attributes into the page scope. In an effort to figure out what was happening I downloaded the jstl 1.0.6 and built a debug project in eclipse so I could step into the ForEach tag and I am not sure what I am really looking at yet in there but it appears that indeed the item does contain a string and that the items collection on the tag has a "somewhat" string delimited representation of the collection. See below: This is that actual value in the string in the debugger... Is this how it is stored then is ir "reconstituted" into SimpleMenuItem(s) as the tag loops. The string "looks" like a collection because of the "," i.e. it looks like a string tokenizer. [SimpleMenuItem[value=nav.adminhome, link=/aems/session/changefiltertoken.do?btnResetFilter=true, tooltip=impersonationItem, ], SimpleMenuItem[value=nav.account, link=/aems/party/persondetail.do, ], SimpleMenuItem[value=nav.organization, link=/aems/party/organizationdetail.do, ], SimpleMenuItem[value=nav.library, link=/aems/file/filelibrarylist.do, ], SimpleMenuItem[value=nav.addressbook, link=/aems/communication/personsearchlist.do, ], SimpleMenuItem[value=nav.help, link=#, tooltip=help, ], SimpleMenuItem[value=nav.logout, link=/aems/logout.do, ]] And give this sting in the items - the actual when call to next() within the EnumeratonAdapter way in the ForEachSupport class actuall calls the StringTokenizer and returns an item of: [SimpleMenuItem[value=nav.adminhome So it looks like it went to the first "," and thus the subject of my email might really be changed to: "What is causing ForEach to read/load my tiles putlist collection as a string and not as a collection of the SimpleMenuItems they really are"? Pretty darn long subject :> On a side note - not sure if this means anything - when I compiled the course I was required by eclipse to add two new methods to the PageContextImpl in the org.apache.taglibs.standard.lang.jstl.test package does it looks like perhaps the different JSP version might be an issue. i.e. will jstl 1.0.6 work in Tomcat 5.0.28? /* (non-Javadoc) * @see javax.servlet.jsp.JspContext#getExpressionEvaluator() */ public ExpressionEvaluator getExpressionEvaluator() { // TODO Auto-generated method stub return null; } /* (non-Javadoc) * @see javax.servlet.jsp.JspContext#getVariableResolver() */ public VariableResolver getVariableResolver() { // TODO Auto-generated method stub return null; } Thanks, Jerry -Original Message- From: Mark Lowe [mailto:[EMAIL PROTECTED] Sent: Friday, December 03, 2004 2:49 AM To: Struts Users Mailing List Subject: Re: JSTL, Tiles PutList and Tomcat 5.028 Have you done this in the jsp? MArk On Thu, 2 Dec 2004 12:39:01 -0700, Jim Barrows <[EMAIL PROTECTED]> wrote: > > > > > > -Original Message- > > From: Jerry Rodgers [mailto:[EMAIL PROTECTED] > > Sent: Thursday, December 02, 2004 12:11 PM > > To: [EMAIL PROTECTED] > > Subject: JSTL, Tiles PutList and Tomcat 5.028 > > > > > > Hi All, > > > > > > > > I have a jsp page that I am trying to run on Tomcat that > > currently works in > > Weblogic. It appears the primary problem is that the forEach > > tag is not > > putting the variable menuItem into the pageContext attributes > > and or it > > thinks the menuItem is of type String. I am not sure where my actually > > problem is (tiles, tomcat etc). > > > > > > > > > > > > It appears Tomcat is generating code when compiling the JSP > > that isn't aware > > of the type of class the > > org.apache.struts.tiles.beans.SimpleMenuItem is - > > it looks like at run time it thinks it is a String. > > > > > > > > > > > > A snippet of my JSP looks like this (jstl tags - partial): > > > > > > > > > > > > > > I do something similar in my code, and it works. > It does look like it's not figuring out what type the menuItem is though > > > > > > > > > When I check the pageContext attributes via a debugger I > > actually see an > > item in the collection with the key "topnav" and it c
RE: JSTL, Tiles PutList and Tomcat 5.028
One other thing to add :> there is a "key" in the pageContext attributes called topnav and that DOES contain an actual collection of SimpleMenuItems. The plot thickens - how does the ForEach get the collection? -Jerry -Original Message- From: Jerry Rodgers [mailto:[EMAIL PROTECTED] Sent: Friday, December 03, 2004 8:02 AM To: 'Struts Users Mailing List'; 'Mark Lowe' Subject: RE: JSTL, Tiles PutList and Tomcat 5.028 Hi Matk, I have the following statement Which I "think" am lead to believe it imports all the attributes into the page scope. In an effort to figure out what was happening I downloaded the jstl 1.0.6 and built a debug project in eclipse so I could step into the ForEach tag and I am not sure what I am really looking at yet in there but it appears that indeed the item does contain a string and that the items collection on the tag has a "somewhat" string delimited representation of the collection. See below: This is that actual value in the string in the debugger... Is this how it is stored then is ir "reconstituted" into SimpleMenuItem(s) as the tag loops. The string "looks" like a collection because of the "," i.e. it looks like a string tokenizer. [SimpleMenuItem[value=nav.adminhome, link=/aems/session/changefiltertoken.do?btnResetFilter=true, tooltip=impersonationItem, ], SimpleMenuItem[value=nav.account, link=/aems/party/persondetail.do, ], SimpleMenuItem[value=nav.organization, link=/aems/party/organizationdetail.do, ], SimpleMenuItem[value=nav.library, link=/aems/file/filelibrarylist.do, ], SimpleMenuItem[value=nav.addressbook, link=/aems/communication/personsearchlist.do, ], SimpleMenuItem[value=nav.help, link=#, tooltip=help, ], SimpleMenuItem[value=nav.logout, link=/aems/logout.do, ]] And give this sting in the items - the actual when call to next() within the EnumeratonAdapter way in the ForEachSupport class actuall calls the StringTokenizer and returns an item of: [SimpleMenuItem[value=nav.adminhome So it looks like it went to the first "," and thus the subject of my email might really be changed to: "What is causing ForEach to read/load my tiles putlist collection as a string and not as a collection of the SimpleMenuItems they really are"? Pretty darn long subject :> On a side note - not sure if this means anything - when I compiled the course I was required by eclipse to add two new methods to the PageContextImpl in the org.apache.taglibs.standard.lang.jstl.test package does it looks like perhaps the different JSP version might be an issue. i.e. will jstl 1.0.6 work in Tomcat 5.0.28? /* (non-Javadoc) * @see javax.servlet.jsp.JspContext#getExpressionEvaluator() */ public ExpressionEvaluator getExpressionEvaluator() { // TODO Auto-generated method stub return null; } /* (non-Javadoc) * @see javax.servlet.jsp.JspContext#getVariableResolver() */ public VariableResolver getVariableResolver() { // TODO Auto-generated method stub return null; } Thanks, Jerry -Original Message- From: Mark Lowe [mailto:[EMAIL PROTECTED] Sent: Friday, December 03, 2004 2:49 AM To: Struts Users Mailing List Subject: Re: JSTL, Tiles PutList and Tomcat 5.028 Have you done this in the jsp? MArk On Thu, 2 Dec 2004 12:39:01 -0700, Jim Barrows <[EMAIL PROTECTED]> wrote: > > > > > > -Original Message- > > From: Jerry Rodgers [mailto:[EMAIL PROTECTED] > > Sent: Thursday, December 02, 2004 12:11 PM > > To: [EMAIL PROTECTED] > > Subject: JSTL, Tiles PutList and Tomcat 5.028 > > > > > > Hi All, > > > > > > > > I have a jsp page that I am trying to run on Tomcat that > > currently works in > > Weblogic. It appears the primary problem is that the forEach > > tag is not > > putting the variable menuItem into the pageContext attributes > > and or it > > thinks the menuItem is of type String. I am not sure where my actually > > problem is (tiles, tomcat etc). > > > > > > > > > > > > It appears Tomcat is generating code when compiling the JSP > > that isn't aware > > of the type of class the > > org.apache.struts.tiles.beans.SimpleMenuItem is - > > it looks like at run time it thinks it is a String. > > > > > > > > > > > > A snippet of my JSP looks like this (jstl tags - partial): > > > > > > > > > > > > > > I do something similar in my code, and it works. > It does look like it's not figuring out what type the menuItem is though > > > > > > > > > When I check the pageContext attributes via a debugger I > > actually see an > > item in the collection with the key "topnav" and it c
RE: JSTL, Tiles PutList and Tomcat 5.028
Hi Matk, I have the following statement Which I "think" am lead to believe it imports all the attributes into the page scope. In an effort to figure out what was happening I downloaded the jstl 1.0.6 and built a debug project in eclipse so I could step into the ForEach tag and I am not sure what I am really looking at yet in there but it appears that indeed the item does contain a string and that the items collection on the tag has a "somewhat" string delimited representation of the collection. See below: This is that actual value in the string in the debugger... Is this how it is stored then is ir "reconstituted" into SimpleMenuItem(s) as the tag loops. The string "looks" like a collection because of the "," i.e. it looks like a string tokenizer. [SimpleMenuItem[value=nav.adminhome, link=/aems/session/changefiltertoken.do?btnResetFilter=true, tooltip=impersonationItem, ], SimpleMenuItem[value=nav.account, link=/aems/party/persondetail.do, ], SimpleMenuItem[value=nav.organization, link=/aems/party/organizationdetail.do, ], SimpleMenuItem[value=nav.library, link=/aems/file/filelibrarylist.do, ], SimpleMenuItem[value=nav.addressbook, link=/aems/communication/personsearchlist.do, ], SimpleMenuItem[value=nav.help, link=#, tooltip=help, ], SimpleMenuItem[value=nav.logout, link=/aems/logout.do, ]] And give this sting in the items - the actual when call to next() within the EnumeratonAdapter way in the ForEachSupport class actuall calls the StringTokenizer and returns an item of: [SimpleMenuItem[value=nav.adminhome So it looks like it went to the first "," and thus the subject of my email might really be changed to: "What is causing ForEach to read/load my tiles putlist collection as a string and not as a collection of the SimpleMenuItems they really are"? Pretty darn long subject :> On a side note - not sure if this means anything - when I compiled the course I was required by eclipse to add two new methods to the PageContextImpl in the org.apache.taglibs.standard.lang.jstl.test package does it looks like perhaps the different JSP version might be an issue. i.e. will jstl 1.0.6 work in Tomcat 5.0.28? /* (non-Javadoc) * @see javax.servlet.jsp.JspContext#getExpressionEvaluator() */ public ExpressionEvaluator getExpressionEvaluator() { // TODO Auto-generated method stub return null; } /* (non-Javadoc) * @see javax.servlet.jsp.JspContext#getVariableResolver() */ public VariableResolver getVariableResolver() { // TODO Auto-generated method stub return null; } Thanks, Jerry -Original Message- From: Mark Lowe [mailto:[EMAIL PROTECTED] Sent: Friday, December 03, 2004 2:49 AM To: Struts Users Mailing List Subject: Re: JSTL, Tiles PutList and Tomcat 5.028 Have you done this in the jsp? MArk On Thu, 2 Dec 2004 12:39:01 -0700, Jim Barrows <[EMAIL PROTECTED]> wrote: > > > > > > -Original Message- > > From: Jerry Rodgers [mailto:[EMAIL PROTECTED] > > Sent: Thursday, December 02, 2004 12:11 PM > > To: [EMAIL PROTECTED] > > Subject: JSTL, Tiles PutList and Tomcat 5.028 > > > > > > Hi All, > > > > > > > > I have a jsp page that I am trying to run on Tomcat that > > currently works in > > Weblogic. It appears the primary problem is that the forEach > > tag is not > > putting the variable menuItem into the pageContext attributes > > and or it > > thinks the menuItem is of type String. I am not sure where my actually > > problem is (tiles, tomcat etc). > > > > > > > > > > > > It appears Tomcat is generating code when compiling the JSP > > that isn't aware > > of the type of class the > > org.apache.struts.tiles.beans.SimpleMenuItem is - > > it looks like at run time it thinks it is a String. > > > > > > > > > > > > A snippet of my JSP looks like this (jstl tags - partial): > > > > > > > > > > > > > > I do something similar in my code, and it works. > It does look like it's not figuring out what type the menuItem is though > > > > > > > > > When I check the pageContext attributes via a debugger I > > actually see an > > item in the collection with the key "topnav" and it contains > > a Vector of > > items that appear to be of type SimpleMenuItem. However I > > never see the item > > called menuItem that I thought the forEach tag would place in > > there for me. > > And I think the tutorial is agreeing with you: > The forEach tag allows you to iterate over a collection of objects. You specify the collection via the items attribute, and the current item is available through a scope variable
RE: JSTL, Tiles PutList and Tomcat 5.028
Hi Matk, I have the following statement Which I "think" am lead to believe it imports all the attributes into the page scope. In an effort to figure out what was happening I downloaded the jstl 1.0.6 and built a debug project in eclipse so I could step into the ForEach tag and I am not sure what I am really looking at yet in there but it appears that indeed the item does contain a string and that the items collection on the tag has a "somewhat" string delimited representation of the collection. See below: This is that actual value in the string in the debugger... Is this how it is stored then is ir "reconstituted" into SimpleMenuItem(s) as the tag loops. The string "looks" like a collection because of the "," i.e. it looks like a string tokenizer. [SimpleMenuItem[value=nav.adminhome, link=/aems/session/changefiltertoken.do?btnResetFilter=true, tooltip=impersonationItem, ], SimpleMenuItem[value=nav.account, link=/aems/party/persondetail.do, ], SimpleMenuItem[value=nav.organization, link=/aems/party/organizationdetail.do, ], SimpleMenuItem[value=nav.library, link=/aems/file/filelibrarylist.do, ], SimpleMenuItem[value=nav.addressbook, link=/aems/communication/personsearchlist.do, ], SimpleMenuItem[value=nav.help, link=#, tooltip=help, ], SimpleMenuItem[value=nav.logout, link=/aems/logout.do, ]] And give this sting in the items - the actual when call to next() within the EnumeratonAdapter way in the ForEachSupport class actuall calls the StringTokenizer and returns an item of: [SimpleMenuItem[value=nav.adminhome So it looks like it went to the first "," and thus the subject of my email might really be changed to: "What is causing ForEach to read/load my tiles putlist collection as a string and not as a collection of the SimpleMenuItems they really are"? Pretty darn long subject :> On a side note - not sure if this means anything - when I compiled the course I was required by eclipse to add two new methods to the PageContextImpl in the org.apache.taglibs.standard.lang.jstl.test package does it looks like perhaps the different JSP version might be an issue. i.e. will jstl 1.0.6 work in Tomcat 5.0.28? /* (non-Javadoc) * @see javax.servlet.jsp.JspContext#getExpressionEvaluator() */ public ExpressionEvaluator getExpressionEvaluator() { // TODO Auto-generated method stub return null; } /* (non-Javadoc) * @see javax.servlet.jsp.JspContext#getVariableResolver() */ public VariableResolver getVariableResolver() { // TODO Auto-generated method stub return null; } Thanks, Jerry -Original Message- From: Mark Lowe [mailto:[EMAIL PROTECTED] Sent: Friday, December 03, 2004 2:49 AM To: Struts Users Mailing List Subject: Re: JSTL, Tiles PutList and Tomcat 5.028 Have you done this in the jsp? MArk On Thu, 2 Dec 2004 12:39:01 -0700, Jim Barrows <[EMAIL PROTECTED]> wrote: > > > > > > -Original Message- > > From: Jerry Rodgers [mailto:[EMAIL PROTECTED] > > Sent: Thursday, December 02, 2004 12:11 PM > > To: [EMAIL PROTECTED] > > Subject: JSTL, Tiles PutList and Tomcat 5.028 > > > > > > Hi All, > > > > > > > > I have a jsp page that I am trying to run on Tomcat that > > currently works in > > Weblogic. It appears the primary problem is that the forEach > > tag is not > > putting the variable menuItem into the pageContext attributes > > and or it > > thinks the menuItem is of type String. I am not sure where my actually > > problem is (tiles, tomcat etc). > > > > > > > > > > > > It appears Tomcat is generating code when compiling the JSP > > that isn't aware > > of the type of class the > > org.apache.struts.tiles.beans.SimpleMenuItem is - > > it looks like at run time it thinks it is a String. > > > > > > > > > > > > A snippet of my JSP looks like this (jstl tags - partial): > > > > > > > > > > > > > > I do something similar in my code, and it works. > It does look like it's not figuring out what type the menuItem is though > > > > > > > > > When I check the pageContext attributes via a debugger I > > actually see an > > item in the collection with the key "topnav" and it contains > > a Vector of > > items that appear to be of type SimpleMenuItem. However I > > never see the item > > called menuItem that I thought the forEach tag would place in > > there for me. > > And I think the tutorial is agreeing with you: > The forEach tag allows you to iterate over a collection of objects. You specify the collection via the items attribute, and the current item is available through a scope variable
JSTL, Tiles PutList and Tomcat 5.028
Hi All, I have a jsp page that I am trying to run on Tomcat that currently works in Weblogic. It appears the primary problem is that the forEach tag is not putting the variable menuItem into the pageContext attributes and or it thinks the menuItem is of type String. I am not sure where my actually problem is (tiles, tomcat etc). It appears Tomcat is generating code when compiling the JSP that isn't aware of the type of class the org.apache.struts.tiles.beans.SimpleMenuItem is - it looks like at run time it thinks it is a String. A snippet of my JSP looks like this (jstl tags - partial): my tiles def looks like this (partial): and the generated servlet code looks like this - Is Jasper not compiling this correctly??? _jspx_th_core_when_0.setTest((java.lang.String) org.apache.jasper.runtime.PageContextImpl.proprietaryEvaluate("${menuItem.to oltip=='help'}", java.lang.String.class, (PageContext)_jspx_page_context, null, false)); And when the page runs I get this serlet exception: ServletException in:/menu.do?menu=topnav] Unable to find a value for "tooltip" in object of class "java.lang.String" using operator "."' When I check the pageContext attributes via a debugger I actually see an item in the collection with the key "topnav" and it contains a Vector of items that appear to be of type SimpleMenuItem. However I never see the item called menuItem that I thought the forEach tag would place in there for me. Thanks for any help you may be able to provide, Jerry Rodgers
JSTL, Tiles PutList and Tomcat 5.028
Hi All, I have a jsp page that I am trying to run on Tomcat that currently works in Weblogic. It appears the primary problem is that the forEach tag is not putting the variable menuItem into the pageContext attributes and or it thinks the menuItem is of type String. I am not sure where my actually problem is (tiles, tomcat etc). It appears Tomcat is generating code when compiling the JSP that isn't aware of the type of class the org.apache.struts.tiles.beans.SimpleMenuItem is - it looks like at run time it thinks it is a String. A snippet of my JSP looks like this (jstl tags - partial): my tiles def looks like this (partial): and the generated servlet code looks like this - Is Jasper not compiling this correctly??? _jspx_th_core_when_0.setTest((java.lang.String) org.apache.jasper.runtime.PageContextImpl.proprietaryEvaluate("${menuItem.to oltip=='help'}", java.lang.String.class, (PageContext)_jspx_page_context, null, false)); And when the page runs I get this serlet exception: ServletException in:/menu.do?menu=topnav] Unable to find a value for "tooltip" in object of class "java.lang.String" using operator "."' When I check the pageContext attributes via a debugger I actually see an item in the collection with the key "topnav" and it contains a Vector of items that appear to be of type SimpleMenuItem. However I never see the item called menuItem that I thought the forEach tag would place in there for me. Thanks for any help you may be able to provide, Jerry Rodgers