Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Struts portlet question for Cameron

 
Cold Gin
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi, Cameron. I just picked up your portlet book on Amazon a few days ago, and I was hoping I could ask you a question.

I'm sure that you have migrated an existing Struts application to a portal in your travels.

a.) How do you handle an application that relies on cookie processing within the portal (I believe JSR-168 does not officially support them). I have ran a few tests on JBoss Portal 2.6.1, and the cookie values only exist if you pull them like this (the familiar req.getKookies() method returns null):



b.) Have you ever migrated an application that uses JSTL tags? What would be involved in doing so?

Thanks!
 
Cameron Wallace McKenzie
author and cow tipper
Saloon Keeper
Posts: 4968
1
Hibernate Spring Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes, the old 'cookie in a portlet' problem.

You're right, I don't actually deal with that in the book, largely because there are not inherent ways to deal with cookies in a portlet, largely because portlsts aren't supposed to deal with page handlers. I do believe the theme in a JBoss portal can though. You might be able to do a little hacking in your theme and thus, make the cookie available as a page or context wide property? Just a thought.

Here's a link to an interesting page about hacking the cookie from a portlet. It might give you some more ideas:

http://www.doc.ic.ac.uk/~mo197/portlets/portlet_messaging/old_sessionidretrievers.php

-Cameron McKenzie
 
Cold Gin
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks. I have seen that page during my research. I realize that the portlets work differently from regular servlet processing. I am just amazed that there is no cookie support in JSR-168. I thought that I was missing something...

I believe that cookie support will be added in JSR-286.

How about JSTL tags? Is there any special tag libraries that would have to be included to "portletize" a JSTL page?

Thanks.
 
Cameron Wallace McKenzie
author and cow tipper
Saloon Keeper
Posts: 4968
1
Hibernate Spring Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I've been thinking about the JSTL question for a bit. Just thinking about it, I've never had to migrate a JSTL heavy web page to a portal - or at least, if I did, the JSTL part was buried from me.

At their heart, JSP pages in portlets are very similar to JSP pages in a Servlet/JSP application. Many of the tags will work as is. Obviously, you might get peculiar behavior if you have a tag that reads the request or response object.

Hmmmm...Maybe a good idea for a chapter for the next printing of the Portlet Development Book.

-Cameron McKenzie
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic