• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • paul wheaton
  • Liutauras Vilda
  • Ron McLeod
Sheriffs:
  • Jeanne Boyarsky
  • Devaka Cooray
  • Paul Clapham
Saloon Keepers:
  • Scott Selikoff
  • Tim Holloway
  • Piet Souris
  • Mikalai Zaikin
  • Frits Walraven
Bartenders:
  • Stephan van Hulst
  • Carey Brown

how do i find the referring page in struts

 
Ranch Hand
Posts: 919
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I hope someone who knows struts better than me can help.
I have a jsp and it is doing various jsp includes. one of the included jsps is a form in its own right. The form is included on various different jsp's.
What I wanted to find out is whether I can find out from either the ActionForm object or from the Action servlet what the originating page was.
Does anyone know where I can find this out from?
All replies are much appreciated.
George
 
Ranch Hand
Posts: 237
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Try this

or with the javaScript
 
Sheriff
Posts: 17734
302
Mac Android IntelliJ IDE Eclipse IDE Spring Debian Java Ubuntu Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I'm not sure if that approach will work so here's my $0.02. If you get stuck approaching a problem one way, I find it's often useful to try the opposite direction. In your case, instead of the included JSP trying to find out what included it, I would turn the tables around and have every JSP that used the common one identify itself. E.g.
<jsp:include page="common.jsp">
<jsp:param name="caller" value="this.jsp" />
</jsp:include>
It all depends on whether you're actually using dynamic or static includes though, or if you are using something like Tiles.
[ April 01, 2003: Message edited by: Junilu Lacar ]
 
George Brown
Ranch Hand
Posts: 919
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks Junilu,
that was one of the approaches that I had already tried, but the use of <jsp:include> tags rather than <%@include> messed up the presentation of the page, so I abandoned it.
 
Junilu Lacar
Sheriff
Posts: 17734
302
Mac Android IntelliJ IDE Eclipse IDE Spring Debian Java Ubuntu Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by George Brown:
the use of <jsp:include> tags rather than <%@include> messed up the presentation of the page, so I abandoned it.


Not sure how this could be. What was happening? maybe there's something that can be done about it.
 
George Brown
Ranch Hand
Posts: 919
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I think it may have worked if I was using frames, but as it is I am using tables (no frames) and in that context, with the struts tags, there is an essential difference between the way the include directive processes included files and the way the jsp:include processes included pages.
That jsp:include difference messes up the tables by not compiling the logic tags correctly (I don't know why)...
Here is an example...
(if you substitute jsp:include where you see login.jsp included you will see the difference)
alhome.jsp

--
login.jsp
 
George Brown
Ranch Hand
Posts: 919
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
by the way, you may need to remove the header and footer includes to see what i mean (i've not included those files, or the .css, so the page might look a bit odd, but you should see what i mean).
You will probably also need to hardcode some of the bean tags...
[ April 03, 2003: Message edited by: George Brown ]
 
Junilu Lacar
Sheriff
Posts: 17734
302
Mac Android IntelliJ IDE Eclipse IDE Spring Debian Java Ubuntu Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Not sure if what you posted for login.jsp is elided or not but if it isn't then you need to declare the taglib tlds again for them to work with the dynamic jsp:include
 
my overalls have superpowers - they repel people who think fashion is important. Tiny ad:
We need your help - Coderanch server fundraiser
https://coderanch.com/wiki/782867/Coderanch-server-fundraiser
reply
    Bookmark Topic Watch Topic
  • New Topic