New window in jsp

hi there!!!!
actually i want to display a new and seperate window in jsp,and in which we would able to display a fragment of parent jsp.I couldn't been success so for..plz post ur sugessions
thanks....

JSPs can't do it, because they are server side and new windows are made on the client side.
You could have a link that has a target of a new window that the user clicks on, or you could use javascript to do it for you. Either way look Google and search for either html link new window or javascript open new window

Similar Messages

  • JSF app - open report in new Window - via JSP?

    I have been reading through this forum but no one has done quite what I am trying so I thought I'd post my own version of this problem.
    The web app I'm working on is basically a report generator. Data is formatted via XSLT to .html files - that part works great. The problem is getting the app to open this new HTML file in a new window. I want to get this working with little or no JavaScript.
    startReport.jsp (a JSF file) is the form that validates the user input. The sole h:commandButton (I do NOT want a link) works fine sending the form and JSF returns its errors or mine (if the criteria results in nothing) as it should; the action method returns "failure" so the page stays the same.
    But when the action method returns "success" the JSF navigation-rule is setup to route to showReportFile.jsp (which is NOT a JSF file). This JSP is very simple:
    <%@ page import="java.io.File" %>
    <%@ page import="java.io.PrintWriter" %>
    <%@ page import="java.io.FileReader" %>
    <%@ page import="com.logipath.gict.cts.reporting.client.ReportClient" %>
    <%@ page language="java" contentType="text/html; charset=ISO-8859-1" pageEncoding="ISO-8859-1" %>
    <jsp:useBean id="reportClient" scope="session" class="com.logipath.gict.cts.reporting.client.ReportClient" />
    <%
    String fileName = reportClient.getReportOutputFile();
    PrintWriter writer = response.getWriter();
    char[] buffer = new char[1024];
    FileReader reader = new FileReader(fileName);
    int numRead = reader.read(buffer, 0, buffer.length);
    while ( numRead != -1 ) {
         writer.write(buffer, 0, numRead);
         numRead = reader.read(buffer, 0, buffer.length);
    reader.close();
    writer.close();
    File file = new File(fileName);
    file.delete();
    %>This works believe it or not. If I put the target="_blank" on the form tag in the startReport.jsp it even opens in a new window. Great. But with that attribute on the form element, if the page comes back in error - it shows up in a new window (as it is apt to do given the attiribute).
    Ok, the h:commandButton tag's target attribute is ignored. Fine. There has to be a way to do this but I just cannot figure it out and I'm no JSP expert.
    What I think will work is this. Since my report beans create HTML files, I've created a session bean called "currentReportBean" which holds a single attribute - the name of the HTML file to display. (This is how the JSP above works.)
    What I need to know now *(this is the question part)* is how can I flush the render response of my JSF life cycle, trigger the opening of this JSP in a new window, the restart the JSF life cycle at the begining so the "parent" page repaints normally? The JSP isn't part of the JSF page flow so I there's no "going back" or "refresh" to worry about. I would like to take the showReportFile.jsp file out of the navigation files altogether.
    I know this topic has been worked on at length, but not quite this way. Any help is greatly appreciated.

    arnieAustin wrote:
    No, the JSP resets the bean value after showing the file.My mistake; it wasn't the reload scenario that is an issue. It is when the user goes back and forth in history that this can be a problem.
    >
    But now I'm confused. JS cannot access server-based session values. How is it going to know to open the page? A cookie?Write the value to a JS variable when you render the page.

  • How can i set the session of a new window?

    I am placing in session an object from an action class like this request.getSession().setAttribute("currentBean",orderInfoModel.getDetails()); and i use it into a jsp page to print some informations. The page name is called orders.jsp where i use the object: <jsp:useBean id = "currentBean" scope="session" type="miru.orderInfo.OrderInfoBean"/> on that page i have a button and when i click it it opens me a new window(not a new tab) <input type="button" value="Edit" onclick="openWindow('http://localhost:8080/miru/scrisoareTransport.jsp','ScrisoareDeTransport',1150,600)">
    the jsp for the new window(scrisoareTransport.jsp) looks like this :
    <%@ include file="taglibs.jsp" %>
    <%@ page import="database.navigator.Navigator"%>
    <jsp:useBean id = "currentBean" scope="session" type="miru.orderInfo.OrderInfoBean"/>
    <html>
    </html>
    Because IE is starting a new session on new window i need to pass the session and probably the currentBean object from the parent page to the childpage and set the child page session with the one coming from the parent page
    Advices?
    10x

    well, the Gaussian window and the Gaussian Monopulse vis are good starting points,  I would start with the window vi, but with a shorter length and add zeros before and after to get the full window with the peak at the desired position.
    If
    Greetings from Germany
    Henrik
    LV since v3.1
    “ground” is a convenient fantasy
    '˙˙˙˙uıɐƃɐ lɐıp puɐ °06 ǝuoɥd ɹnoʎ uɹnʇ ǝsɐǝld 'ʎɹɐuıƃɐɯı sı pǝlɐıp ǝʌɐɥ noʎ ɹǝqɯnu ǝɥʇ'

  • How to redirect a page to a new window instead of the current one

    Can someone please tell me how to redirect a page to new window.
    I mean I am running a JSP with a button and on clicking it i am opening a new window (thru javascript offcourse),
    Now response.sendirect("New.jsp") should be opened in that new window opened.
    I tried it but the New.jsp page is opened in the current page (Even though new window is opened ! ).
    Please help.

    Hi,
    U can use the following code to Pop up in new window
    Jsp1.jsp
    <%
    if(action != "")
    response .sendRedirect("Jsp2.jsp");
    else
    %>
    <html><head><title>JSP 1</title>
    <script language="JavaScript">
    function View()
    window.open("Jsp1.jsp?action=view","View","");
    </script>
    </head><body>
    <form name="frm" method="post">
    <input type="button" value="View" onclick="View()">
    </form>
    </body>
    </html>
    <%

  • How to preserve ViewObject result when running 2nd query in new window?

    I have a prompt.jsp page that users enter information which is used to pass parameters to a DataAction to filter a view object.
    In the results.jsp page (built against the ViewObject's DataControl) I provide a drill facility that executes the same DataAction (passing different parameters) and pops-up a new window (results.jsp).
    In results.jsp I have a 'Download to Excel' button. Obviously if I click this button in the first page I get the results of the second query. How do I preserve the values of the first ViewObject? Is there a way to create a new 'session' for each new browser window?
    This is driving me mad!
    Thanks,
    Chris.

    You can use tool area iview.
    Duplicate the tool area iview.  you can find this iview in  Content provided by SAP -> Admin interfaces.
    Tool area iview is nothing but the search iview in masthead area.
    Once you made a local copy then give youe search option set and search component set.
    You will get the results in  a new window.
    Raghu

  • Can you open a second jsp page as popup/new window?

    Hi all gurus!
    I have a question regarding popups/new windows in an iview application. Instead of starting with a question let me instead describe what I want to do.
    We have a jsp page that presents a search and then the search result in a table where one column is "clickable". When the user clicks a cell a server round trip retreives data specific for that cell value. This is standard functionality and already fixed so here is what differes: we want a new jsp window to open like a popup, with the data retreived from the server round trip and at the same time the first page with the table shall still be there so that you just can close the popup and click the next cell which creates a new server round trip and a new jsp popup and so on.
    My solution which doesn't work yet: In application "a" I have a JavaScript for the clicked cell which opens another iview application "b" in a new window, by window.open("navurl_to_the_iview"), and that works fine.
    At the same time the value of the clicked cell is written to the data bean and the bean is put in the http session (since component session does not reach between applications).
    The second iview "b" retreives the bean from the http session and fills the jsp page with data.
    Here is now the problem: no data is displayed and this because the iview "b" retreives the bean BEFORE iview "a" has been able to put the bean/value into the http session. How do I know this for sure? Simple, if I do a refresh of iview "b" the value is displayed.
    I could do a JavaScript that recursively checks if the value in the bean is null or not but then I have to do a method that retreives the bean from the http session each time.
    This could work but I wonder if this is the most simple solution. So my question for you gents and madams is: do you know of a more simple solution?
    Best regards
    Benny Lange
    Edited by: Benny Lange on Oct 6, 2009 11:33 AM

    Hi you all.
    In this case the solution was to pass the id in the url to the second iview and let that iview use the id to retreive data from the backend system.
    But I still think the question is interesting, if it's possible to open a second jsp window after a server round trip and still have the first one open.
    All the best
    Benny

  • Open a JSP from an ScreenFlow in a new window

    Hi all, a have a proccess in wich I get user input with a Screen Flow. The ScreenFlow has some JSP to collect user data (User Information, Economical data, Provider, ....). Some of the fields in the JSP needs to be filled with information that is in a database. For example, the is a field "Provider" that needs to be search in a database. I want to open a JSP in a new window in order to show a list of provider (or whatever other data I need). This JSP in a new window would return the data in a specific field.
    Now, I have done this modelling in the ScreenFlow but if the JSP form has lot of field of that kind the proccess get very complex.
    There is any way to open a JSP in a new Window (from a presentation of a ScreenFlow) without loosing the JSP context? (i mean having the ability to access BPM methods and data).
    Thanks in advance.

    Do you want to open a jsp application in a frame when you click on the applet?If so, there is a programme in http://www.globalleafs.com -Java-Java Applets 's download section. Check it out.

  • To open a pdf document or word document from a JSP into a new window

    Hi,
    How to open a PDF document or word document from a JSP into a new window. i.e say from a jsp when a hyperlink or button is clicked it should open a new window with the pdf document or word document in it.
    thanks in advance,
    radki_j

    Hi ,
    when i tried to use the below code to open my word document , it will open as html and with some garbage details. Doesnt open as word document. How to solve this kind of probem?Need advice urgently.
    Open Document

  • Want to open jsp in a new window

    Hi,
    I'm using JSPDyanPage. I've a search iview. In search.jsp if the user clicks on "Search button" then
    after firing database qry in the Java file, the control
    comes back to search.jsp. And onload of this jsp I want
    open result.jsp in a new window.
    Any idea how to implement this. Will the bean be available in the new popup window. In search.jsp I tried to open result.jsp by writing javascript
    window.open("result.jsp");
    But its giving me error: iView not found: result.jsp
    Any help will be highly appreciated.
    Thanks,
    Dhiman

    Hi Dhiman,
    the most simple thing would be to react on client side within search.jsp (not directly on server side) on the "Search" button. The client side should call some JS, which reads the search term from the input field and calls your component within a new window (by window.open("</irj/.../portalappname.portalcomponentname>"> or by EPCM.doNavigate, this would be calling the iView instead of directly calling the component implementation, with parameters to open the destination in a new window.
    You would pass the search string as url parameter, so no bean problems here. After calling this JS, you would stop the server roundtrip for search.jsp.
    See http://help.sap.com/saphelp_nw04/helpdata/en/26/71c74030308431e10000000a1550b0/frameset.htm for EPCF.
    See http://help.sap.com/saphelp_nw04/helpdata/en/43/067941a51a1a09e10000000a155106/frameset.htm for JS API for HTMLB elements.
    See http://devnetmedia.sap.com/html/submitted_docs/htmlbManuals/button_dev.html for htmlb button details and how to stop the server roundtrip.
    Hope it helps
    Detlev
    PS: Please consider rewarding points on SDN for helpful answers. Thanks in advance!

  • Jsf problem go from jsp page to another jsp in new window

    I’ve two jsp pages attendReport.jsp and printAttendReport.jsp
    attendReport.jsp contains inputs for attend duration and employee id and command button “view” to view attendance data entered employee during entered duration inside the same page(this work very good)
    the problem is the same page includes another command button “print” its job is to get the same data but view them in the second page printAttendReport.jsp in another window in order to print the data in some suitable format , but the print button opens attendReport.jsp instead of printAttendReport.jsp and does not hold the inputs else if I set <managed-bean-scope> to session not request which cause caching data , please help me if you to solve this problem
    and here the related lines of code
    <faces-config >
    <managed-bean>
    <managed-bean-name>attendReportBean</managed-bean-name>
    <managed-bean-class>csc.attend.bean.AttendReportBean</managed-bean-class>
    <managed-bean-scope>request</managed-bean-scope>
    </managed-bean>
    <navigation-rule>
    <from-view-id>/attend/attendReport.jsp</from-view-id>
    <navigation-case>
    <from-action>#{AttendReportBean.attendReport}</from-action>
    <from-outcome>attendReport</from-outcome>
    <to-view-id>/attend/attendReport.jsp</to-view-id>
    </navigation-case>
    </navigation-rule>
    <navigation-rule>
    <from-view-id>/attend/attendReport.jsp</from-view-id>
    <navigation-case>
    <from-action>#{AttendReportBean.printAttendReportAction}</from-action>
    <from-outcome>printAttendReportAction</from-outcome>
    <to-view-id>/attend/printAttendReport.jsp</to-view-id>
    </navigation-case>
    </navigation-rule>
    </faces-config> // here is managed bean code
    public class AttendReportBean {
    // data , getters and setters
    init();
    //Preload in initialization block.
    public void init() {
    // initialize data
    public String attendReport() {
    // code to get attend data to go to view page(same page) it is ok
    return "attendReport"; // Navigation case.
    public static String getRequestParameter(String name) {
    return (String) FacesContext.getCurrentInstance().getExternalContext()
    .getRequestParameterMap().get(name);
    public void printAttendReportListener(ActionEvent event) {
    String fromYearStr = getRequestParameter("fromYearAtt");
    System.out.println("fromYearStr = "+fromYearStr);
    // try to get inputs through ActionListener but it gives me null
    public String printAttendReportAction() {
    // code to get attend data to go to print page(another page in new //window) but inputs come in default values
    return "printAttendReportAction"; // Navigation case.
    }attendReport.jsp
    <%@ taglib uri="http://java.sun.com/jsf/html" prefix="h"%>
    <%@ taglib uri="http://java.sun.com/jsf/core" prefix="f"%>
    <f:view>
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    //title . styles and validations //
    </head>
    <body>
    <h:form id="attendReportForm">/the form tag appear in running source as <form id="attendReportForm" method="post" action="/newdiwan/faces/attend/attendReport.jsp" enctype="application/x-www-form-urlencoded" >
    i.e. it always submit to attendReport.jsp page
    / some inputs and outputs /
    <h:commandButton onclick="return check();" id="view" action="#{attendReportBean.attendReport}" value="" styleClass="linksNumBlue" />//it works good/
    // some outputs to view data /
    <h:commandLink immediate="true" id="printLink" value="" action="#{attendReportBean.printAttendReportAction}" actionListener="#{attendReportBean.printAttendReportListener}" target="_blank" styleClass="linksNumBlue">
        <f:attribute  name="fromYearAtt" value="2009" />
        <f:attribute  name="fromMonth" value="01" />
       <f:attribute  name="toYear" value="2010" />
       <f:attribute  name="toMonth" value="06" />
    </h:commandLink>//this has two problems 1)submit to attendReport.jsp not printAttendReport.jsp which I want to go to.
    //2)does not get the inputs but return the default values only /
    </h:form></body></html></f:view>I use libraries { jsf-api.jar , jsf-impl.jar , jstl-1.1.0.jar and tomahawk-1.1.6.jar } and deploy on tomcat 6.0
    I’m sorry for the prolongation, please help me if you can
    Edited by: alynoor on Jul 8, 2010 1:51 AM
    Edited by: alynoor on Jul 8, 2010 1:55 AM

    my problem solved 1- i use 2 managed bean , one of request scope (used in attendReport.jsp ) and the other with session scope (used in printAttendReport.jsp)
    2 - add new jsp contains the h:commandLink of the print (attendReportPrintAction.jsp)
    3 - divide the view of attendReport.jsp to two subviews (each subview has its own form) one contains inputs and outputs of attend and the other contains include to (attendReportPrintAction.jsp)
    <%@ include file="attendReportPrintAction.jsp" %>
    4 - send and get parameters using two methods
                public static Object getSessionMapValue(String key) {
                   return FacesContext.getCurrentInstance().getExternalContext().getSessionMap().get(key);
                public static void setSessionMapValue(String key, Object value) {
                   FacesContext.getCurrentInstance().getExternalContext().getSessionMap().put(key, value);
                }faces-config.xml
       <managed-bean>
          <managed-bean-name>attendReportBean</managed-bean-name>
          <managed-bean-class>csc.attend.bean.AttendReportBean</managed-bean-class>
          <managed-bean-scope>request</managed-bean-scope>
       </managed-bean>
        <managed-bean>
          <managed-bean-name>print_attendReportBean</managed-bean-name>
          <managed-bean-class>csc.attend.bean.AttendReportBean</managed-bean-class>
          <managed-bean-scope>session</managed-bean-scope>
       </managed-bean>
    <navigation-rule>  
        <display-name>viewReport</display-name>  
        <from-view-id>/attend/attendReport.jsp</from-view-id>  
        <navigation-case>  
            <from-action>#{AttendReportBean.attendReport}</from-action>
            <from-outcome>attendReport</from-outcome>  
            <to-view-id>/attend/attendReport.jsp</to-view-id>  
        </navigation-case>  
    </navigation-rule>
    <navigation-rule>  
        <display-name>printReport</display-name>
        <from-view-id>/attend/attendReport.jsp</from-view-id>  
        <navigation-case>  
            <from-outcome>printAttendReportAction</from-outcome>  
            <to-view-id>/attend/printAttendReport.jsp</to-view-id>  
        </navigation-case>  
    </navigation-rule>attendReportPrintAction.jsp
    <f:subview id="printAttendReportSubView" >
    <h:form id="printAttendReportForm" onsubmit="return check222();" >
                                <table width="100%" border="0" cellpadding="0" cellspacing="0">
                                  <tr>
                                    <td width="11%">
                                    <table width="70" border="0" cellpadding="0" cellspacing="0">
                                        <tr>
                                          <td width="7" height="28"><img src="../images/B-left.gif" width="7" height="28" /></td>
                                          <td align="center" background="../images/B-bg.gif">
                                            <!--a href="printAttendReport.jsp" class="linksNumBlue" target="_blank" >&#1591;&#1576;&#1575;&#1593;&#1577;</a-->
    <h:commandLink id="printLink" value="&#1591;&#1576;&#1575;&#1593;&#1577;" title="&#1591;&#1576;&#1575;&#1593;&#1577;"  action="#{print_attendReportBean.printAttendReportAction}"   target="_blank"  styleClass="linksNumBlue">
                                        </h:commandLink>
                                            </td>
                                          <td width="7" height="28"><img src="../images/B-right.gif" width="7" height="28" /></td>
                                        </tr>
                                      </table>
                                      </td>
                                    <td align="right"> </td>
                                  </tr>
                                </table>
    </h:form>
    </f:subview>i hope this helps someone

  • JSP Dynpage iView 'Open in New Window' losses session data

    Hi All,
    I have a JSP Dynpage that displays some position holder information based on a position id passed in by the URL query string.  The problem that I am trying to solve is to allow the user to open the iView in its own window by using the 'Open in New Window' option from the button in the upper right of the iView title bar.  When this happens the URL query string is no longer available so the iView has problems.  My solution is to store the position id in the session object then read from that session object when the query string is not available - when opening in a new window.
    But what is happening is that the position id saved in the session object is no longer there when the new window opens.  I have looked else where on this site but all posts seem to deal with data transfer from JSP Dynpage to the JSP page.  This issue is dealing with a page getting re-opened in a new page (browswer). 
    I can't seem to get the session object to work between JSP Dynpages at all, I would think that the data put into the session would stay there untill either cleared or the session ends.  Am I missing some configuration settings?  I have included some of the key code below.
    // GET THE POSITION ID FROM THE URL QUERY STRING
    String PosId;
    PosId = request.getParameter("CKey");          
    if (PosId == null)
         myBean.testing = (String) request.getComponentSession().getValue("PosId");     
    else
         PosId = PosId.substring(6, 14);
         request.getComponentSession().putValue("PosId", PosId);
         myBean.testing = "POSID:" + PosId;
    Thanks for all ideas and help. 
    Don

    All of this logic is within the doProcessBeforeOutput event.  Here is all my java code and JSP...
    <%@ taglib uri="tagLib" prefix="hbj" %>
    <hbj:content id="myContext" >
         <hbj:page title="PageTitle">
              <hbj:form id="myFormId" >
                   <jsp:useBean id="myBean" scope="application" class="MSSBeanPackage.HolderDetailBean"></jsp:useBean>
                        <% response.write("<br>xxxx-" + myBean.testing + "-zzzz<br>"); %>
                        <hbj:textView id="txtEname" text="<%=myBean.getEname()%>" design="HEADER2"/>
                        <hbj:textView id="txtPernr" text="<%='(' + myBean.getPernr() + ')' %>" design="HEADER3"/>
                        <hbj:gridLayout rowSize="1" columnSize="1" cellSpacing="2">
                                <hbj:gridLayoutCell columnIndex="1" rowIndex="1" width="100%" verticalAlignment="TOP">
                                  <hbj:group     id="grpContractData"
                                                 design="SAPCOLOR"
                                                 title="Contract Data"
                                                 tooltip="Contract Data"
                                                 width="100%">
                                       <hbj:groupBody>
                                            <hbj:formLayout id="myForm"
                                                           marginTop="5px"
                                                           marginRight="5px"
                                                           marginBottom="5px"
                                                           marginLeft="5px"
                                                           width="300px"     >
                                                 <hbj:formLayoutRow     id="Row1" paddingTop="1px" paddingBottom="1px" >
                                                      <hbj:formLayoutCell     id="Cell11"     align="LEFT" width="40%" >
                                                              <hbj:label
                                                               id="label_WorkContract"
                                                               text="Work Contract xx"
                                                               design="LABEL"
                                                               labelFor="WorkContract"></hbj:label>
                                                      </hbj:formLayoutCell>
                                                      <hbj:formLayoutCell     id="Cell12"     align="LEFT" width="40%" >
                                                           <hbj:textView
                                                               id="WorkContract"
                                                               text="<%=myBean.getAnsvh_Text()%>"
                                                               design="STANDARD"
                                                           />
                                                      </hbj:formLayoutCell>
                                                 </hbj:formLayoutRow>
                                                 <hbj:formLayoutRow     id="Row2" paddingTop="1px" paddingBottom="1px" >
                                                      <hbj:formLayoutCell     id="Cell21"     align="LEFT" width="40%" >
                                                           <hbj:label
                                                               id="label_HiringDate"
                                                               text="Hiring Date"
                                                               design="LABEL"
                                                               labelFor="HiringDate"></hbj:label>
                                                      </hbj:formLayoutCell>
                                                      <hbj:formLayoutCell     id="Cell22"     align="LEFT" width="40%" >
                                                           <hbj:textView
                                                               id="HiringDate"
                                                               text="<%=myBean.getEntry_Date()%>"
                                                               design="STANDARD"
                                                           />
                                                      </hbj:formLayoutCell>
                                                 </hbj:formLayoutRow>
                                            </hbj:formLayout>
                                       </hbj:groupBody>
                                  </hbj:group>
                             </hbj:gridLayoutCell>
                        </hbj:gridLayout>
              </hbj:form>
         </hbj:page>
    </hbj:content>
    *******************  JAVA
    package MSSPackage;
    import MSSBeanPackage.HolderDetailBean;
    import com.sapportals.htmlb.*;
    import com.sapportals.htmlb.enum.*;
    import com.sapportals.htmlb.event.*;
    import com.sapportals.htmlb.page.DynPage;
    import com.sapportals.htmlb.page.PageException;
    import com.sapportals.portal.htmlb.page.JSPDynPage;
    import com.sapportals.portal.htmlb.page.PageProcessorComponent;
    import com.sapportals.portal.prt.component.IPortalComponentContext;
    import com.sapportals.portal.prt.component.IPortalComponentProfile;
    import com.sapportals.portal.prt.component.IPortalComponentRequest;
    // SAP RFC Imports
    import com.sap.mw.jco.IFunctionTemplate;
    import com.sap.mw.jco.JCO;
    import com.sap.mw.jco.JCO.Table;
    import com.sapportals.portal.prt.service.jco.IJCOClientPoolEntry;
    import com.sapportals.portal.prt.service.jco.IJCOClientService;
    import com.sapportals.portal.prt.runtime.PortalRuntime;
    public class HolderDetail extends PageProcessorComponent {
      public DynPage getPage(){
         return new HolderDetailDynPage();
      public static class HolderDetailDynPage extends JSPDynPage{
         JCO.Repository mRepository;
         public void doInitialization(){
              // Define request, context and profile containers
              IPortalComponentRequest reqst = (IPortalComponentRequest) this.getRequest();
              IPortalComponentContext myContext = reqst.getComponentContext();
              IPortalComponentProfile myProfile = myContext.getProfile();
              // Define bean reference to bean
              HolderDetailBean myBean = new HolderDetailBean();
              // Place bean in user profile.
              myProfile.putValue("myBean", myBean);
         public void doProcessAfterInput() throws PageException {
         public void doProcessBeforeOutput() throws PageException {
              // Define request, context and profile containers
              IPortalComponentRequest request = (IPortalComponentRequest) this.getRequest();
              IPortalComponentContext myContext = request.getComponentContext();
              IPortalComponentProfile myProfile = myContext.getProfile();
              //Get Bean from Profile
              HolderDetailBean myBean = (HolderDetailBean) myProfile.getValue("myBean");
              String sapSystem = "SAP_R3_HumanResources";
              // GET THE POSITION ID FROM THE URL QUERY STRING
              String PosId;
              PosId = request.getParameter("CKey");
              //PosId = "60004790";
              if (PosId == null)
                   myBean.testing = (String) request.getComponentSession().getValue("PosId");
              else
                   PosId = PosId.substring(6, 14);
                   request.getComponentSession().putValue("PosId", PosId);
                   myBean.testing = "POSID:" + PosId;
              this.setJspName("HolderDetailJSP.jsp");
    Thanks for your thoughts.

  • Jsp dyn page open form results in new window

    Hi everybody,
    I have a problem dispaying results in new window.
    My portal component is a dyn page that dispay several jsp pages based on a integer switch parameter checked in the
    doProcessBeforeOutput method.
    One page is a form with a button that call onSearch custom method inside my component; this method process the request,
    fill the bean and set the integer switch that doProcessBeforeOutput check then get the right jsp.
    All works fine but I want to display the onSearch method results in a new window.
    What I have to do?
    Thanks,
    Andrea

    Hi Andrea,
         I am also facing the same issue.
    Were you able to call the component method from the JavaScript code.
    I have to display the results in a new page.
    Will all the methods like doProcessBeforeOutput() be executed when we traverse after the search button is clicked ?
    Thanks in advance,
    Brian.
    Edited by: Brian Fernandes on Mar 30, 2010 12:34 PM

  • JSP automatically opening new window

    I have been using the following construct in my servlets to get to my JSP.
    RequestDispatcher rd = new RequestDispatcher(URL);
    rd.forward();
    This works well.
    Now, I want to be able to automatically
    open a new window from the JSP and
    pass the request and response.
    Is this possible?

    If you want to forward the request and the response obj from the servlet to the jsp then use this:
    //inside servlet
    RequestDispatcher rd = request.getRequestDispatcher( URL );
    rd.forward(request, response);
    the request object of the servlet is capable of retrieving the RequestDispatcher.
    then when you call the forward method you can pass the request and response object to the resource specified in the getRequestDispatcher.
    As far as opening the jsp page in a new window that can be done in html.
    Here is an idea of what it might look like:
    //inside jsp
    <someHtmlTag target="_window">
    something like that. I am just not sure which html tag it should be placed in.
    I'll get back to you.
    I hope this helps
    logikalone

  • Spawning new browser windows with jsp

    in a webapp, is there a jsp way to open a new browser window? i'd like to avoid javascript if i can....

    Definetely not. JSP is 100% server-side, it has nothing to do with the client-side (browser). You cannot do anything in the client-side with JSP.
    You will have to use either HTML or JavaScript.
    A seven-second Google-lookup with the keywords "opening new browser windows" yields as a second link:
    Dan's Web Tips: Opening New Browser Windows
    http://webtips.dantobias.com/new-window.html

  • Open New window (pop-up) in JSP

    Is there a way to open a new window (pop-up) in JSP (not using Javascript:window.open()).
    I basically have a JSP that checks user enter data. The If user enter incorrect data it will redirect to itself with a http session value (f-failed) to indicate the type of data error and display proper error message.
    If user enter all correct data then it will display a new window (pop-up) in front of the previous window. All also passing values to the new window!
    Whats the window.open() in JSP?
    THanks

    What about trying this scenario:
    1. from your first jsp submit to a modal window
    var returnVal = window.showModalDialog("yourServlet","",
    "dialogHeight:600px;dialogWidth:800px;status:no;help:no");
    2. The servlet sets an error code in the request object i.e. 0 good, -1 bad.
    3. forward to a page (I call the page database_status.jsp) and get the error code. With javascipt do this:
    <%
    // get return code
    String returnCode = (String)request.getAttribute("databaseStatus");
    %>
    window.returnValue = parseInt("<%= returnCode %>");
    self.close();
    4. read the return code
    if(returnVal == 0)
    alert('code is good');
    or pop up your window.

Maybe you are looking for