[opencms-dev] obtaining the current URL of the calling page

Christian Steinert christian_steinert at web.de
Fri Oct 16 14:56:05 CEST 2009


Christoph P. Kukulies wrote:
> I have "page with free text" object which has a jsp template behind it.
> The jsp has html code for building a form in it and invokes another jsp
> which evaluates the form (checks for mandatory fields and plausibility)
What do you mean by "invoke"? Do you include the other JSP or do you 
issue a redirect?

If you do a redirect, then you are on a different page and you would 
have to inspect the "referrer" HTTP header, which might not necessarily 
be sent by the client or have to keep some session state, etc..

If you just include another JSP into your template, then the call of

   cms.info("opencms.url");

will return the URL of the overall page and you should not have a problem

Best regards
Christian
> .
>
> In case some fields were not filled in I would like to invoke the same
> page with a parameter (or a list of paramters) indicating which fields
> were not filled in correctly.
>
> (I would then frame the required fields in red or something)
> Anyway, I need a mechanism to find out the URL of the
> "page with free text" that has that form jsp template.
>
> When I do something like 
>
>  CmsJspActionElement cms = new CmsJspActionElement(pageContext, request, response);
>  String thisurl = cms.info("opencms.url");
>
> I'm getting the URL of the jsp.
>
> Thanks for helping.
>
> --
> Chris Christoph P. U. Kukulies kukulies (at) rwth-aachen.de
>
> _______________________________________________
> This mail is sent to you from the opencms-dev mailing list
> To change your list options, or to unsubscribe from the list, please visit
> http://lists.opencms.org/mailman/listinfo/opencms-dev
>
>   




More information about the opencms-dev mailing list