adding querystring to url - Websphere

This is a discussion on adding querystring to url - Websphere ; I have a requirement to add a querystring to all requests under a subcontext of wps/portal and wps/myportal, is this possible. I am currently trying to use a servlet filter but its not working as desired. Example /wps/portal/subcontexta should result ...

+ Reply to Thread
Results 1 to 11 of 11

Thread: adding querystring to url

  1. adding querystring to url

    I have a requirement to add a querystring to all requests under a subcontext of wps/portal and wps/myportal, is this possible. I am currently trying to use a servlet filter but its not working as desired.



    Example

    /wps/portal/subcontexta



    should result in

    /wps/portal/subcontexta?param1=abc&param2=123



    Any help would be greatly appreciated

  2. Re: adding querystring to url

    well two problems here

    first of is this only for the first request to wps/portal or all subsequent requests? if subsequent you will need to put it after the rich part of the url(the encoded pieces) or portal will not work correctly. I saw you said subcontext, but not sure if you meant just adding the query params at the end of all urls or what the goal was.



    secondly, what do you want to be able to read these params? jsr 168 portlets? by the spec they will not be able to see these.




    IBM Certified System Administrator -- WebSphere Portal V6.0, V5.1, V5.0

    IBM Certified Solution Developer -- WebSphere Portal V5.1, v6.0



    The postings on this site are my own and do not necessarily represent the positions, strategies, or opinions of IBM

  3. Re: adding querystring to url

    Thanks for your reply.

    All requests will need to have the parameters appended to the url. How can I add the parameters?


    Thanks

  4. Re: adding querystring to url

    well you could just grab the url and apply it at the end, but you will need to make sure no params are there,



    what are you expecting to read these params?



    What is your servlet filter doing now?





    IBM Certified System Administrator -- WebSphere Portal V6.0, V5.1, V5.0

    IBM Certified Solution Developer -- WebSphere Portal V5.1, v6.0



    The postings on this site are my own and do not necessarily represent the positions, strategies, or opinions of IBM

  5. Re: adding querystring to url

    We are using non jsr 168 portlets and I am setting the same values in the request parameters.

    The requirement is if the url parameters are there then set the same values in request parameters, if they are not on the url and request has the required cookies set them in both places. You said to tag them onto the url, can you explain how this can be done.


    Thanks

  6. Re: adding querystring to url

    well just take the full url and add the params you want to, to it.



    What are you doing now that is not working?

    Jim




    IBM Certified System Administrator -- WebSphere Portal V6.0, V5.1, V5.0

    IBM Certified Solution Developer -- WebSphere Portal V5.1, v6.0



    The postings on this site are my own and do not necessarily represent the positions, strategies, or opinions of IBM

  7. Re: adding querystring to url

    i agree I just add the parameters to url, but I need for the url on the request to reflect the additional parameters and thus when the browser gets the reply the url changes are reflected.



    Example initial request from client

    /wps/portal/contexta



    reply

    /wps/portal/contexta?param1=abc&param2=123

  8. Re: adding querystring to url

    well in your servlet filter, you could parse through your html and add the params there, before sending the response, or create a custom tag library that you parse through to add the params, so they are there when the user clicks on them, instead of having to trap them on the inbound




    IBM Certified System Administrator -- WebSphere Portal V6.0, V5.1, V5.0

    IBM Certified Solution Developer -- WebSphere Portal V5.1, v6.0



    The postings on this site are my own and do not necessarily represent the positions, strategies, or opinions of IBM

  9. Re: adding querystring to url

    I am sorry I must have not been very clear in my response. I need to have the url in the browser reflect the change in url not links in the html. I do not want to have to deal with every link on every portlet. I would prefer for the filter to handle this in one central location. Is this possible? If so, how?


    Thanks for your help

  10. Re: adding querystring to url

    well I looked into this more, and I think at most you can add attributes to the request not params. So I think that is about your only option

    Jim





    IBM Certified System Administrator -- WebSphere Portal V6.0, V5.1, V5.0

    IBM Certified Solution Developer -- WebSphere Portal V5.1, v6.0



    The postings on this site are my own and do not necessarily represent the positions, strategies, or opinions of IBM

  11. Re: adding querystring to url

    you can try using the StateManagerService in the filter. I have'nt used it but the functionality you need is achievable.

+ Reply to Thread