aspose file tools*
The moose likes Struts and the fly likes Struts:: want to display full url for certain resources Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Soft Skills this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Struts:: want to display full url for certain resources" Watch "Struts:: want to display full url for certain resources" New topic
Author

Struts:: want to display full url for certain resources

Shin Hashitani
Ranch Hand

Joined: Dec 04, 2001
Posts: 54
Tomcat 4.0.4
Struts 1.1-b2
/--situation--/
The site contains several sections, and most of them are available only thru logon. One section is to display articles, and they are intended for everyone to see. those articles are split into parts and reassembled at runtime by JavaBean. Each article has its own unique numeric id.

Hi everybody,
It would be nicer if a visitor copy url for a certian article, and pasting to that url in the address field of a browser displays the exact same page for everyone.
http//mysite.com/view?articleid=8798764
Or something like that.
Pages will be added automatically and not known at compile time.
I am still trying to figure out Struts, and I am still not so sure about what I don't know. This could be a general servlet issue, but I post it here because I am just not sure.
If you know how to do what I am trying to do,
please teach me. Or please redirect me to some good resources if you know.
Thank you.


/*<br /> * Quants Inc.<br /> * Engineer<br /> *<br /> * Shin Hashitani<br /> * hashitani@quants.co.jp<br /> * <a href="http://www.quants.co.jp" target="_blank" rel="nofollow">www.quants.co.jp</a><br />*/
Adam Hardy
Ranch Hand

Joined: Oct 09, 2001
Posts: 566
I guess it depends on your articles. Are they stored in a database or as part of a content management system or are they HTML files?


I have seen things you people would not believe, attack ships on fire off the shoulder of Orion, c-beams sparkling in the dark near the Tennhauser Gate. All these moments will be lost in time, like tears in the rain.
Shin Hashitani
Ranch Hand

Joined: Dec 04, 2001
Posts: 54
Hi adam,
thank you for the reply.
The article is saved on the database: they are divided into some parts when saved, and regenerated as one article on request. (I cannot change that part. I am just not powerful enough to do that.)
When the user doesn't accept cookies, the session ids will be displayed, won't they? I thought that I could just ignore the session id part in URL for publicly displayed articles, but still the session id will be visible and that's something I want to avoid if I can.
Adam Hardy
Ranch Hand

Joined: Oct 09, 2001
Posts: 566
I'm really not sure if you can disable the session id url rewriting.
Have you tried destroying the session before you forward to the JSP?
Shin Hashitani
Ranch Hand

Joined: Dec 04, 2001
Posts: 54
Hi Adam,
thanks for the reply.

I have been digging around for a while, and I haven't able to find a solution that I am looking for. Also, I have learned a bit about Struts in general. I'll leave this problem alone for a while.
I was also surprised to find that using html:rewrite for images as Ted Husted suggests also shows the session id after the file name. (My friend tells me that it just should, but I am still having trouble understanding why, though.)
It's has been such a fun ride.
But it took me quite a while to get the general idea of Struts.
I will post here if I find something to solve this one.

Thank you,
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Struts:: want to display full url for certain resources