File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes JSP and the fly likes Calling Action class in pop up window Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Java Interview Guide this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Java » JSP
Bookmark "Calling Action class in pop up window" Watch "Calling Action class in pop up window" New topic

Calling Action class in pop up window

Raghu Nathan
Ranch Hand

Joined: Jan 16, 2006
Posts: 44
I have a requirement where when the user clicks a link, I have to open a pop up window. There will be a number of links and each one will pass a different id to the Action class of the child (pop up) page.
The catch is that I am not supposed to use query string - how can I achieve this?

Please let me know if you have a clue ... thanks

Thanks ... Raghu
Ben Souther

Joined: Dec 11, 2004
Posts: 13410

You can do this with:
  • Javascript by changing hidden form fields and the submitting the form from the onclick event of the hyperlink.
  • A front controller that reads the URL of the request and determines what action to take accordingly.

  • Java API J2EE API Servlet Spec JSP Spec How to ask a question... Simple Servlet Examples jsonf
    Raghu Nathan
    Ranch Hand

    Joined: Jan 16, 2006
    Posts: 44
    Thanks for the response ...
    I had tried doing that - I submitted the page with different hidden ctrl values and in the (parent) action class I tried to forward it to the child action. However, when I did this, the parent window showed the child window contents and vice-versa! (I hope you are able to follow what I mean)
    I know I screwed up - but where, I am not able figure out.

    Thanks again

    My code in jsp

    function setValues(topId,sideId,type)
    if (type == 'TRKCOMP')
    document.forms[0].stSasId.value = sideId;
    document.forms[0].stObjId.value = topId;
    document.forms[0].stSasId.value = topId;
    document.forms[0].stObjId.value = sideId;
    document.forms[0].viewHistory.value = 'Y';


    Code in parent action class

    else if (screenParams.get("viewHistory") != null) {
    String strSasId = (String) screenParams.get("stSasId");
    String strObjId = (String) screenParams.get("stObjId");"strSasId" + strSasId);"strObjId" + strObjId);

    sessionManager.setAttribute("strObjId", new SessionObject(strObjId));
    sessionManager.setAttribute("strSasId", new SessionObject(strSasId));
    return mapping.findForward("viewHistory");
    Bear Bibeault
    Author and ninkuma

    Joined: Jan 10, 2002
    Posts: 63870

    Please use UBB code tags when posting code to preserve its formatting. I will not read unformatted code. Please read this for more info.

    [Asking smart questions] [About Bear] [Books by Bear]
    Raghu Nathan
    Ranch Hand

    Joined: Jan 16, 2006
    Posts: 44
    Sorry about that folks - I was not aware. Here is the code in JSP and Action Class in the meantime.

    Code in parent action class

    I agree. Here's the link:
    subject: Calling Action class in pop up window
    It's not a secret anymore!