Passing values to included jsp via bean

Hi people
I've got a jsp fragment which is used by many jsp's. It outputs a dynamic menu. It gets its data from a bean, say MenuBean. The jsp which "includes" menu.jsp does a jsp:usebean then jsp:setproperty's on MenuBean. When I run the project nothing comes up in the menu (It works if I hardcode the values in MenuBean).
Under debug I can see that after the first jsp:usebean an instance (say #9360) is created with the properties set correctly. But when menu.jsp runs, it looks like a new instance of MenuBean (say #110636) is created with the properties blank.
in home.jsp:
<jsp:useBean id="menubean" class="web.MenuBean" scope="session"/>
<jsp:setProperty name="menubean" property="login"
value="${userBean.login}"/>
<jsp:setProperty name="menubean" property="topLevel" value="Home"/>
<jsp:include page="/WEB-INF/jspf/menu.jsp" />
in menu.jsp:
<jsp:useBean id="menubean" class="web.MenuBean" scope="session"/>
I've tried changing the scope to request or application, but it's always the same result. A new instance of MenuBean is created when menu.jsp runs. What I need is a single instance of MenuBean running throughout the session and accessible by every jsp that's called up. How can I do/achieve this?
I'd appreciate any help on this matter.
Thanks.

Hi Ram - thanks for your reply.
I have made it work, but I'm not sure which of the changes I made is the one that fixed it. I believe it is because I didn't implement serializable in my MenuBean. By doing so it now works!!
thankyou & bye

Similar Messages

  • How to pass value from the jsp file to a java bean

    I have huge promblem .I want to pass value of combo box to bean file to set my database contecting.The is how i call function to pass database to the bean file
    <%db.setDatabase(database);%>are coding to set my databse connection
    private String database;
        public Conn(){
         try{
                   Class.forName("org.gjt.mm.mysql.Driver");
                   DriverManager.registerDriver((Driver) Class.forName("org.gjt.mm.mysql.Driver").newInstance());
                   String data=getDatabase();
                   String url = "jdbc:mysql://localhost/"+data;
                   Connection conn = DriverManager.getConnection(url);
                   setConnection(conn);
              catch(SQLException e){
                   System.out.println(e.toString());
              catch(Exception e){
                   System.out.println(e.toString());
         public void setDatabase(String Database){
          this.database = Database;
         public String getDatabase(){
         return this.database;
         }     and Below are error produce
    Note: sun.tools.javac.Main has been deprecated.
    /mrs/system_menu.jsp:18: Method setDatabase(java.lang.String) not found
    in class bgoc.dbConn.Conn.
    db.setDatabase(database);
    ^
    1 error, 1 warning
    please help me soon. any that come to your will help
    thank you

    I have huge promblem .I want to pass value of combo box to bean file to set my database contecting.The is how i call function to pass database to the bean file
    <%db.setDatabase(database);%>are coding to set my databse connection
    private String database;
        public Conn(){
         try{
                   Class.forName("org.gjt.mm.mysql.Driver");
                   DriverManager.registerDriver((Driver) Class.forName("org.gjt.mm.mysql.Driver").newInstance());
                   String data=getDatabase();
                   String url = "jdbc:mysql://localhost/"+data;
                   Connection conn = DriverManager.getConnection(url);
                   setConnection(conn);
              catch(SQLException e){
                   System.out.println(e.toString());
              catch(Exception e){
                   System.out.println(e.toString());
         public void setDatabase(String Database){
          this.database = Database;
         public String getDatabase(){
         return this.database;
         }     and Below are error produce
    Note: sun.tools.javac.Main has been deprecated.
    /mrs/system_menu.jsp:18: Method setDatabase(java.lang.String) not found
    in class bgoc.dbConn.Conn.
    db.setDatabase(database);
    ^
    1 error, 1 warning
    please help me soon. any that come to your will help
    thank you

  • Passing value from one jsp to another?

    how to pass value from one jsp to another? i have a value assigned in the link, i want to pass that value to another jsp page?
    please help with code?

    Instead of the value being passed, i am getting a null value.
    Here is my calendar code:
    <%@page import="java.util.*,java.text.*" %>
    <html>
    <head>
    <title>Print a month page.</title>
    </head>
    <body bgcolor="white">
    <%
                  boolean yyok = false;
                  int yy = 0, mm = 0;
                  String yyString = request.getParameter("year");
                  if (yyString != null && yyString.length() > 0)
                      try
                          yy = Integer.parseInt(yyString);
                                  yyok = true;
                       catch (NumberFormatException e)
                          out.println("Year " + yyString + " invalid" );
                  Calendar c = Calendar.getInstance( );
                  if (!yyok)yy = c.get(Calendar.YEAR);  
                         mm = c.get(Calendar.MONTH);
    %>
                  <table align="center">
                      <tr>
                  <td>
                       <form method=post action="calendar.jsp">
                          Enter Year : <select name="year">
    <%         
                 for(int i= yy;i<=2010;i++)
    %>
                  <OPTION VALUE= <%=i%> > <%=i%> </option>
    <%       
    %>
              </select>
                      <input type=submit value="Display">
                      </form>
                      </td>
                    </tr>
    <tr>
                     <table>
    <%!
    String[] months = {"January","February","March",
                    "April","May","June",
                    "July","August","September",
                    "October","November", "December"
    int dom[] =     {
                        31, 28, 31, 30,
                        31, 30, 31, 31,
                        30, 31, 30, 31
    %>
    <%
                int leadGap =0;
    %>
    <div id="t1" class="tip"><table border="4" cellpadding=3 cellspacing="3" width="250" align="center" bgcolor="lavender">
    <tr>
    <td halign="centre" colgroup span="7" style="color:#FF0000;">
    </colgroup>
    <tr>
    <td>
    <%
              GregorianCalendar calendar =null;
              for(int j=0;j<12;j++)
                        calendar = new GregorianCalendar(yy, j, 1);
                  int row = 1 ;
                  row = row + j;
        %>
              <table>
                <tr>
              <colgroup span="7" style="color:#FF0000;">
              </colgroup>
                </tr>
              <tr align="center">
              <th colspan=7>
                  <%= months[j] %>
                  <%= yy %>
              </th>
              </tr>
    <tr>
    <td>Sun</td><td>Mon</td><td>Tue</td><td>Wed</td><td>Thu</td><td>Fri</td><td>Sat</td>
    </tr>
    <%
        leadGap = calendar.get(Calendar.DAY_OF_WEEK)-1;
        int daysInMonth = dom[j];
        if ( calendar.isLeapYear( calendar.get(Calendar.YEAR) ) && j == 1)
        ++daysInMonth;
        out.print("<tr>");
        out.print(" ");
          for (int h = 0; h < leadGap; h++)
           out.print("<td>");
          out.print("</td>");
        for (int h = 1; h <= daysInMonth; h++)
          out.print("<td>");
          out.print("<a href=desc.jsp>" + h + "</a>" );
          out.print("</td>");
        if ((leadGap + h) % 7 == 0)
            out.println("</tr>");
    out.println("</tr></table></div>");
    if( row%3 != 0)
    out.println("</td><td>");
    else
    out.println("</td></tr>\n<tr><td>");
    %>
    </html>I need to pass the value in 'h' to the desc.jsp page.
    my code for desc.jsp is :
    <html>
    <head>
    </head>
    <body bgcolor="lightblue">
    <form method=post action="Calenda.jsp">
    <br>
    <%= request.getParameter("h") %>
    <h2> Description of the event <INPUT NAME="description" TYPE=TEXT SIZE=20> </h2>
    <BR> <INPUT TYPE=SUBMIT VALUE="submit">
    </form>
    </body>
    </html>But i am not able to pass the value. The 'h' value contains all the date. i want to pass only a single date, the user clicks to the other page. please help

  • Passing values to the JSP page - Urgent

    Hi all,
    I have to pass the user id value to the JSP page. I have written the following code in the doInitialization() method
    IPortalComponentRequest request = (IPortalComponentRequest) this.getRequest();
    IPortalComponentContext myContext = request.getComponentContext();
    IPortalComponentProfile myProfile = myContext.getProfile();
    IAuthentication ia = UMFactory.getAuthenticator();
    IUser portalUser = ia.getLoggedInUser(request.getServletRequest(), request.getServletResponse(false) );
    s = portalUser.getUniqueName();
    IPortalComponentSession componentSession = ((IPortalComponentRequest)getRequest()).getComponentSession();
    Object o = componentSession.getValue("myEvents");
    myEvents = (LoadEvents)o;
    //myEvents = (LoadEvents) myContext.getValue("myEvents");
    myEvents.setUserId(s);
    myContext.putValue("myBeanName", myEvents);
    I have also defined myEvents as a bean in my JSP page with scope APPLICATION. But I get User Id as "NULL".
    Thanks in advance.
    Rgds,
    Janvi.

    Hi Prakash,
    Please find the jsp code pasted below:
    <hbj:content
        id="myContext">
        <hbj:page
            title="Successful processing">
    <jsp:useBean id="myMeet" scope="application" class="com.sap.ep.bluestar.LoadEvents" />
    <jsp:useBean id="myEvents" class="com.sap.ep.bluestar.MonthView" scope="application" />
    <%@ page contentType="text/html; charset=iso-8859-1" language="java" import="java.sql.*" %>
    <%
    int leadSpaces, daysInMonth, leadSpaces_next,daysInMonth_next, col_Counter;
    myCal.setMonthView();
    java.util.Vector printVal_pre = new java.util.Vector();
    myCal.printMonth(myCal.getPre_month(),myCal.getPre_year());
    printVal_pre = myCal.getPrintValues();
    java.util.Vector printVal_cur = new java.util.Vector();
    myCal.printMonth(myCal.getCur_month(),myCal.getCur_year());
    printVal_cur = myCal.getPrintValues();
    java.util.Vector printVal_next = new java.util.Vector();
    myCal.printMonth(myCal.getNext_month(),myCal.getNext_year());
    printVal_next = myCal.getPrintValues();
    if(request.getMethod().equals("POST")){
         try {
              String action =(String) request.getParameter("action");
              if(action.equals("insert")){
              //     response.sendRedirect("_insertEvent.jsp");
                   //response.sendRedirect("test.html");
         } catch(Exception e) {
              System.out.println(e.getMessage());
    %>
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
    <html>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
    <title>Untitled Document</title>
    <script language="javascript">
         function insertEvent(frm,eventDay){
              alert("here finally " + eventDay + " " + frm.eventMonth.value + "  " + frm.eventYear.value );
              frm.action.value = "insert";
              frm.submit();
         function openWin(frm,eventDay)
           var newWin = window.open("http://localhost:50100/irj/servlet/prt/portal/prtroot/Web_Calendar.eventHandler?variable=" + frm.eventMonth.value +  "/" + eventDay + "/" + frm.eventYear.value, 'popup',
         'resizable,height=200,width=325');
           if(newWin.focus) newWin.focus();
    </script>
    </head>
    <body>
    User is : <%= myCal.getUserId() %>
    <table width="745" height="583" border="0">
      <tr>
        <td width="258" height="23" align="center"><B> <% out.println(printVal_pre.elementAt(0).toString() + "  " + printVal_pre.elementAt(1).toString());
    leadSpaces = ((Integer)printVal_pre.elementAt(2)).intValue();
         daysInMonth = ((Integer)printVal_pre.elementAt(3)).intValue();
         %> </B> </td>
        <td width="215"> </td>
        <td width="258" align="center"><B> <% out.println(printVal_next.elementAt(0).toString() + "  " + printVal_next.elementAt(1).toString());
        leadSpaces_next = ((Integer)printVal_next.elementAt(2)).intValue();
        daysInMonth_next = ((Integer)printVal_next.elementAt(3)).intValue();
         %> </B></td>
      </tr>
      <tr>
        <td height="151"><table width="245" border="1">
          <tr>
            <th width="35" scope="col"><div align="center">S</div></th>
            <th width="35" scope="col"><div align="center">M</div></th>
            <th width="35" scope="col"><div align="center">T</div></th>
            <th width="35" scope="col"><div align="center">W</div></th>
            <th width="35" scope="col"><div align="center">T</div></th>
            <th width="35" scope="col"><div align="center">F</div></th>
            <th width="35" scope="col"><div align="center">S</div></th>
          </tr><tr>
         <% col_Counter = 0;
              for (int i = 0; i < leadSpaces; i++) {
                   out.print("<td> </td>");
                   col_Counter++;
              for (int i = 1; i <= daysInMonth; i++) {
                   // This "if" statement is simpler than messing with NumberFormat
                   if(i < 9) {
                        out.print("<td align='center'>" + " " + i + "</td>");
                        col_Counter++;
                   } else {
                        out.print("<td align='center'>" + i + "</td>");
                        col_Counter++;
                   if ((leadSpaces + i) % 7 == 0) { // Wrap if EOL
                        out.println("</tr><tr>");
              int cnt = col_Counter;
              if(col_Counter == 28){
                   out.println("</tr>");
              }else {
                   for(int i = 0; i < (42 - col_Counter);i++){
                        out.print("<td> </td>");
                        cnt++;
                        if((cnt%7) ==0)
                             out.println("</tr><tr>");
                   out.println("</tr>");
         %>
        </table></td>
        <td> </td>
        <td><table width="245" border="1">
          <tr>
            <th width="35" scope="col"><div align="center">S</div></th>
            <th width="35" scope="col"><div align="center">M</div></th>
            <th width="35" scope="col"><div align="center">T</div></th>
            <th width="35" scope="col"><div align="center">W</div></th>
            <th width="35" scope="col"><div align="center">T</div></th>
            <th width="35" scope="col"><div align="center">F</div></th>
            <th width="35" scope="col"><div align="center">S</div></th>
          </tr>
          <tr>
           <% col_Counter = 0;
              for (int i = 0; i < leadSpaces_next; i++) {
                   out.print("<td> </td>");
                   col_Counter++;
              for (int i = 1; i <= daysInMonth_next; i++) {
                   // This "if" statement is simpler than messing with NumberFormat
                   if(i < 9) {
                        out.print("<td align='center'>" + " " + i + "</td>");
                        col_Counter++;
                   } else {
                        out.print("<td align='center'>" + i + "</td>");
                        col_Counter++;
                   if ((leadSpaces_next + i) % 7 == 0) { // Wrap if EOL
                        out.println("</tr><tr>");
              cnt = col_Counter;
              if(col_Counter == 28){
                   out.println("</tr>");
              }else {
                   for(int i = 0; i < (42 - col_Counter);i++){
                        out.print("<td> </td>");
                        cnt++;
                        if((cnt % 7 ) ==0)
                        out.println("</tr><tr>");
                   out.println("</tr>");
         %>
        </table></td>
      </tr>
      <tr>
        <td colspan="3"><table width="735" height="383" border="1">
          <tr>
          <td colspan="7" align="center"><B> <% out.println(printVal_cur.elementAt(0).toString() + "  " + printVal_cur.elementAt(1).toString());
        leadSpaces = ((Integer)printVal_cur.elementAt(2)).intValue();
        daysInMonth = ((Integer)printVal_cur.elementAt(3)).intValue();
         %> </B></td>
          </tr>
          <tr>
            <th width="105" scope="col">SUN</th>
            <th width="105" scope="col">MON</th>
            <th width="105" scope="col">TUE</th>
            <th width="105" scope="col">WED</th>
            <th width="105" scope="col">THUR</th>
            <th width="105" scope="col">FRI</th>
            <th width="105" scope="col">SAT</th>
          </tr>
          <form name="eventCal" method="post" action="Web_Cal.jsp">
          <input name="eventMonth" type="hidden" value="<%= myCal.getCur_month() + 1 %>">
           <input name="eventYear" type="hidden" value="<%=myCal.getCur_year() %>">
          <input name="action" type="hidden" value="">
          <tr>
            <% col_Counter = 0;
              for (int i = 0; i < leadSpaces; i++) {
                   out.print("<td> </td>");
                   col_Counter++;
              for (int i = 1; i <= daysInMonth; i++) {
                   // This "if" statement is simpler than messing with NumberFormat
                   if(i < 9) {
                        out.print("<td align='center'>" + " " + "<a href='javascript:openWin(document.eventCal," + i + ");'>" + i + "</a></td>");
                        col_Counter++;
                   } else {
                        out.print("<td align='center'>" + "<a href='javascript:openWin(document.eventCal," + i + ");'>" + i + "</a></td>");
                        col_Counter++;
                   if ((leadSpaces + i) % 7 == 0) { // Wrap if EOL
                        out.println("</tr><tr>");
              if(col_Counter == 28){
                   out.println("</tr>");
              }else if(col_Counter < 35){     
                   for(int i = 0; i < (35 - col_Counter);i++)
                        out.print("<td> </td>");
                   out.println("</tr>");
              }else {
                   for(int i = 0; i < (42 - col_Counter);i++)
                        out.print("<td> </td>");
                   out.println("</tr>");
         %> </form>
        </table></td>
      </tr>
    </table>
    </body>
    </html>
    </hbj:textView>
        </hbj:page>
    </hbj:content>
    Regards,
    Janvi

  • Passing parameters to included JSP files using JSF

    I have included JSP, which I use in many other JSP files. I want to display message in this included JSP which depends on the information in JSP files which include this JSP. How can I do this without using scriptlets?
    Message was edited by:
    cheltsov

    I have one included page in one jsp page(mother page). I have included it by jsp:include tag. The included page consists of two inputText. I need to pass the parameters of the mother page together with the parameters in the included page in the backingBean of the mother page. Hope this one is clearer.
    The code snippet in the mother page looks like this
    <jsp:include page="/pages/ps/sample_rep2.jsp"/>.
    In the sample_rep2.jsp, I have two inputText. How can I pass this in the backingBean of the motherpage.
    The sample_rep2.jsp is the included page here. The sample_rep2.jsp looks like this:
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
    "http://www.w3.org/TR/html4/loose.dtd">
    <%@ taglib uri="http://java.sun.com/jsf/core" prefix="f"%>
    <%@ taglib uri="http://xmlns.oracle.com/adf/faces" prefix="af"%>
    <af:panelBox>
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
    "http://www.w3.org/TR/html4/loose.dtd">
    <%@ taglib uri="http://java.sun.com/jsf/core" prefix="f"%>
    <%@ taglib uri="http://xmlns.oracle.com/adf/faces" prefix="af"%>
    <af:panelBox>
    <af:inputText label="User ID" id="userid" value="CDOUGLAS"/>
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
    "http://www.w3.org/TR/html4/loose.dtd">
    <%@ taglib uri="http://java.sun.com/jsf/core" prefix="f"%>
    <%@ taglib uri="http://xmlns.oracle.com/adf/faces" prefix="af"%>
    <af:panelBox>
    <af:inputText label="User ID" id="userid" />
    <af:inputText label="Age" id="age"/>
    </af:panelBox>

  • Passing values from a jsp to a servlet

    I have a jsp which has a search form for customers, first it lets you search by colour, giving options of red, white or all, then gives three options of what price. Im trying to get my servlet to read these choices, and display the results. I have a statement in my serlvet which says:
    String price = request.getParameter("search preference colour");
    and the statment in the JSP is:
    <select name="search preference colour">
    <option value="Red">red</option>
    <option value="White">White</option>
    <option value="All">All</option>
    </select>
    I need to know how to define which option has been chosen, and have the chosen results displayed. I tried an 'if' statement but it didnt seem to work. Thanks

    yuvi wrote:
    i have a servlet from which i am passing result set values to a jsp page.Basically they are database records from a table named basic.
    and these selective fields have to be dissplayed on jsp.i have tried incorporating values into session variables and using them on jsp.it works fine for single record but when there are multiple results it fails!! :(Learn JSTL and use tags. Scriptlet code in JSPs is a bad idea.
    %

  • Passing values to a JSP script from an Applet

    I am having problems to passing arguments to a JSP scipt.
    In the applet the following code is executed:
    URL scoreTrackerURL = new URL(applet.getCodeBase(), "newscore.jsp?name=foo&score=10000");
    URLConnection scoreTrackerConn = scoreTrackerURL.openConnection();
    scoreTrackerConn.connect();
    The JSP-script in the newscore.jsp looks like this:
    <%@ page language="java" %>
    <%@ page import="java.util.*" %>
    <%@ page import="java.net.*" %>
    <%@ page import="java.io.*" %>
    <%
    String name = request.getParameter("name");
    String score = request.getParameter("score");
    BufferedWriter writer = new BufferedWriter(new FileWriter("highscore.txt"));
    writer.write(name + ", " + score);
    writer.close();
    %>
    What am I doing wrong since this doesn�t work!!! I have very little experience of JSP and accessing these scipts from Applets...
    Dukecredits are waiting for You! :) Thank you!

    I tried your code and it works fine.
    public class AppletParam extends Applet {
        public void paint(Graphics g) {
         g.setColor(Color.red);
         g.fillRect(0,0, getSize().width, getSize().height);
         try {
             URL scoreTrackerURL = new URL(getCodeBase(), "newscore.jsp?name=foo&score=10000");
             System.out.println(scoreTrackerURL);
             URLConnection scoreTrackerConn = scoreTrackerURL.openConnection();
             scoreTrackerConn.connect();
         } catch(IOException ioe) {
             ioe.printStackTrace();
    }The call to System.out.println writes the URL that's to be called to the java console in the webbrowser, so you can verify that the method has been called.Any Exceptions that might occour within the method will show up in the same place
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
    <html>
      <head>
        <title>New Score</title>
      </head>
      <body>
        <h1>New Score</h1>
    <%@ page language="java" %>
    <%@ page import="java.util.*" %>
    <%@ page import="java.net.*" %>
    <%@ page import="java.io.*" %>
    <%
    String name = request.getParameter("name");
    String score = request.getParameter("score");
    System.out.println("name=" + name + " score=" + score);
    BufferedWriter writer = new BufferedWriter(new FileWriter("highscore.txt"));
    writer.write(name + ", " + score);
    writer.close();
    %>
      </body>
    </html>Again a call to System.out.println . This time it results in the two parameters being written to the application server log file, so you can see if the jsp was called and what the parameters were.
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
    <html>
      <head>
        <title>test af AppletParam</title>
      </head>
      <body>
        <h1>test af AppletParam</h1>
        <applet codebase="." code="kres_test.AppletParam" width=200 height=200>
        </applet>
      </body>
    </html>The html file with the applet. Remember to place the class file in the correct place. If not you will get an error message in the java console of the webbrowser.
    My tests was performed on a WebLogic 6.1 application server, but there's nothing special about your code, it ought to run on any decent J2EE application server.

  • Passing values from a JSP to Action class

    Hi,
    I have one JSP in this I have two select boxes.
    The first select box is populated with default values.
    From the first select box I am selecting the value and moving to the other select box using java script.
    Now the value in the second select box has to be submitted alongwith some other values which I am getting.
    These values are to be submitted to a Action class and further to the form bean using struts.
    In the form tag in JSP I am calling the struts action class.
    The issue here is,I am able to get other values except the values in the second select box.
    I am using simple JSP page to get form values and submitting.
    I am not using struts tlds because of project constraints.
    Please advise on how to pass these values.
    Regards,
    Ram

    If the value from the select box isn't submitted, then it's not inside the form. Check the HTML output of your JSP to debug this problem.

  • Passing values in a jsp

    I am sending 2 values to the next jsp page from a current jsp page. Am using a form like this
    <form name=report method=get action=./modules/pccr/pccr_assignedengineer_report.jsp target=assignedengineer_report>
    These are the 2 values
    <select name="assignedbu" >
    <td><select name="assignedeng">
    The assignedbu stores a String with a space between the words. When the jsp gets the values its only getting the first word. For example if
    assignedbu = Hello Servlet World; in the original jsp. The next jsp only recieves "Hello". Can anyone tell me how to resolve this..... ?
    Thanks

    sure, i tried passing the string value assignedbu thru
    onClick ="PrintReport(<%=assignedbu)"> all the way in the end, but its giving me some error
    <%@ page import="java.util.*" %>
    <%@ page import="javax.swing.*" %>
    <%
    String assignedbu = "";
    String engineer = request.getParameter("assignedeng");
    assignedbu = request.getParameter("assignedbu");
    try
         if ( assignedbu.equals(null) )
              assignedbu ="";
    catch ( Exception e)
         assignedbu = "";
    JOptionPane.showMessageDialog(null, "BU : " + assignedbu);
    //String bu = request.getParameter("assignedbu");
    %>
    <script>
    function EngList() {
              var assignedbus = document.report.assignedbu.value;
              //     alert ( 'assignedbus : ' + assignedbus )
    window.location ='index.jsp?module=pccr&func=assignedengineer_prereport&assignedbu='+ assignedbus
    function PrintReport() {
         var assignedbus = document.report.assignedbu.value;
         alert ( 'assignedbus : ' + assignedbus )
         window.location ='index.jsp?module=pccr&func=assignedengineer_report&assignedbu=' + assignedbus
    function Refresh()
         window.location ='index.jsp?module=pccr&func=assignedengineer_prereport&assignedbu='
    </script>
    <br>
    <font FACE="VERDANA,ARIAL">Open PCCR/DCR for an Assigned Engineer</font>
    <form name=report method=get action=./modules/pccr/pccr_assignedengineer_report.jsp target=assignedengineer_report>
    <TABLE border=0 cellpadding=0 width=90%>
    <tr>
         <td colspan=20><font FACE="VERDANA,ARIAL" size=2>Select Assigned Business Unit: </font></td>
         <%
         JOptionPane.showMessageDialog(null, "BU : " + assignedbu);
         Context context = MatrixContext.setContext();
         if ( assignedbu.equals("") )
              { %>
         <td><select name="assignedbu" onClick = "EngList()">
         <%
              //JOptionPane.showMessageDialog(null, "assignedbu : in else1 " );
              AttributeType attType = new AttributeType("ASSIGNED BUSINESS UNIT");
              attType.open(context);
              StringList strlist = attType.getChoices();
              strlist.sort();
              for (int i=0; i < strlist.size(); i++)
                   out.println("<option VALUE=\"" + strlist.get(i) + "\" >" + strlist.get(i) );
              attType.close(context);
                   %>      </select></td>
              <% }
              else
                   //JOptionPane.showMessageDialog(null, "in else" );
         %>
              <!-- <td><option value= "assignedbu" > <%=assignedbu%>     </td>     -->
              <td><select name="assignedbu" >
                        <option value= <%=assignedbu%> > <%=assignedbu%> </select>     </td>     
              <%} %>
         <td></td>
         <td colspan=2>
         <input type=button method = post value="Change Business Unit" onclick = "Refresh()">
         </td>
         </tr><tr></tr><tr></tr><tr></tr><tr></tr>
         <tr>
         <td colspan=20><font FACE="VERDANA,ARIAL" size=2>Select Assigned Engineer: </font></td>
         <td><select name="assignedeng">
         <%
         //     JOptionPane.showMessageDialog(null, "BU : " + assignedbu);
              if ( !assignedbu.equals("") )
                   BUReport.assignedbu = assignedbu;
                   PccrRanges pccrRanges = new PccrRanges( context, assignedbu);     
                   ArrayList engineersList = pccrRanges.AssignedEngineers;
                   Object [] obj = engineersList.toArray();
                   Arrays.sort(obj);
                   for (int k=0; k < obj.length; k++)
                        out.println("<option VALUE=\"" + obj[k].toString() + "\">" + obj[k].toString() );
                   //JOptionPane.showMessageDialog(null, "BU : in else " );
              else {
         %>     
              <option value= "assignedeng"> Assigned Engineer
              <% } %>
         </select></td>
         <td></td>
         </tr><tr></tr><tr></tr><tr></tr><tr></tr>
         <tr>
         <td colspan=1><font FACE="VERDANA,ARIAL" size=2></font></td>
         <td>
         </td>
         <td colspan=2>
    <!--      <input type=hidden name=AssignedBusinessUnit value="<%=assignedbu%>"> -->
         <input type=button value="Generate Report" onClick ="PrintReport()">     </td>
    </tr>
    </form>

  • Passing values to a JSP file

    Help!
    This is a very trivial and simple problem but stupid me couldn't figure out. I am developing a web interface with a database. I retrieved some records with a recordset. Now I am passing the id value to the next jsp file. This is what my code looks like:
    <td>
    <a href="someDetail.jsp?id= + ""<%= results.getString("id") %">""><%= results.getString("name") %>
    </a>
    </td>
    Once the screen comes up with all the records and when I click one particular record it goes to the someDetail.jsp file but it is not taking the id with it. In the someDetail.jsp screen the URL looks like this.
    http://localhost/someData/someDetail.jsp?id=
    What am I missing here?
    Sue

    <a href="someDetail.jsp?id= + ""<%=
    results.getString("id") %>""><%=
    results.getString("name") %>Why not just assign a variable to the id? ie.
    <% while (results.next()) {
    String someId = results.getString("id");
    %>
    <td><a href="someDetail.jsp?id=<%=someId%>">Detail Page</a></td>
    <% } %>
    Hope this helps a bit.

  • Passing values to include program

    HI,
    Need help on following.
    in my program A :
    DATA: BEGIN OF it_qlqua OCCURS 0.
            INCLUDE STRUCTURE lqua.
    DATA:   altbatch TYPE ausp-atwrt,
            v_verme TYPE kwmeng.
    DATA: END OF it_qlqua.
    INCLUDE zprogramB.
    perform check_lqua tables it_lqua.
    Program B:
    DATA: BEGIN OF it_qlqua OCCURS 0.
            INCLUDE STRUCTURE lqua.
    DATA:   altbatch TYPE ausp-atwrt,
            v_verme TYPE kwmeng.
    DATA: END OF it_qlqua.
    DATA: v_skzua1 TYPE lagp_skzua,
          v_skzue1 TYPE lagp_skzue,
          v_skzsa1 TYPE lagp_skzsa,
          v_skzse1 TYPE lagp_skzse,
          v_skzsi1 TYPE lagp_skzsi,
          v_lvorm1 type mch1-lvorm,
          v_zustd1 type mch1-zustd,
          v1_skzue1 TYPE lein_skzue,
          v_zskzua1 TYPE lein_skzua,
          v_spgru1 TYPE lvs_spgru,
          v_statu1 type lein-statu.
    FORM zcheck_lqua tables p_it_lqua structure IT_QLQUA.
    ENDFORM.
    Error I get :
    when trying activate :
    statement is not accessible !!
    May i know what have i done wrong?
    What is the correct way to pass internal table to a include file?
    Thanks

    Hi,
    I have made it into simple test but it still fail ?
    report ztest_hl7.
    include zallocation_check2.
    DATA: num  TYPE i VALUE 5,
          fac  TYPE i VALUE 0.
    PERFORM fact USING num CHANGING fac.
    WRITE: / 'Factorial of', num, 'is', fac.
    *&  Include           ZALLOCATION_CHECK2
    FORM fact
           USING f_num TYPE i
           CHANGING f_fact    TYPE i.
      f_fact = 1.
      WHILE f_num GE 1.
        f_fact = f_fact * f_num.
        f_num = f_num - 1.
      ENDWHILE.
    ENDFORM.
    error : statement is not accessible - refer to row perform fact ...

  • Passing values to current jsp page to another jsp page in ADF

    Hi All,
    In my adf application i want to get the appropriate field value of selected row and i want to send that value to the another jsp page from curent jsp page when will we click on button or link.How can i do this.Please give me your valuable suggestions.I'm using jdeveloper 11.1.1.5 version. Thanks!

    Hi,
    Thanks for the reply. I didnt understand the execution of the process. can you please send any sample for text like hello world is passing to second jsp page. or any simple sample?

  • List Box-passing value from one jsp to another

    I have a list box in a .jsp.
    <SELECT name="name">
    <option value ="Fred">Fred
    <option value ="Michael">Michael
    </select>
    <input type="submit"
         value="Names">
    I need to send the name to another .jsp. I don't know how to receive it or send it. I am using form method="post". I need to use the name selected in a query in my next .jsp, so I can select all the data in that has that name in it. I am connecting to a database on the iseries. Do I have to use submit or can I use something else? I wanted to use a link like this.
    <dt valign="left"><img src="bullet1.gif">
    Volunteer</dt>
    of course that didn't work.
    Thanks

    I got it! Never mind!

  • Newbie - How to retrieve a "Boolean" value in a jsp via jsf ?

    Is it possible to retrieve a Boolean value from a BBean from, from let's say a 'rendered' tag ?
    class BBean
    Boolean secure;
    public Boolean getSecure() {...}
    From the jsf:
    <h:outputText value="#{somebean.whatever}" rendered="#{BBean.? == false}" />
    How do I use the Boolean object in an expression like the one above ?
    Note: I've simplified the example above, but I cannot use a primitive boolean for this, the objects I use
    are generated with "Boolean"s and I have no control.
    Thanks in advance !
    Mark

    You should just use boolean instead of Boolean;
    class BBean
    boolean secure;
    public boolean getSecure() {...}
    <h:outputText value="#{somebean.whatever}" rendered="#{bBean.secure == false}" />

  • Passing values between jsp pages

    Hi all,
    I am a newbie to jsp. I am trying to pass value from one jsp to another.
    Let me post the code here and make my point clear. I have 3 jsp pages and am trying to get the value into my 3rd page that was in the first page.
    This is my Test.jsp page:
    <%@page contentType="text/html"%>
    <html>
    <head><title>Test JSP Page</title></head>
    <body>
    <%-- <jsp:useBean id="beanInstanceName" scope="session" class="package.class" /> --%>
    <%-- <jsp:getProperty name="beanInstanceName" property="propertyName" /> --%>
    Testing.. JSP Page
    <FORM action='Response.jsp' method="POST">
    <input type='Text' name='get_name'>
    <input type="submit" value="Click Me">
    </FORM>
    </body>
    </html>
    This is my response.jsp page:
    <%@page contentType="text/html"%>
    <%@page import = "sun.jdbc.rowset.CachedRowSet" %>
    <html>
    <head><title>Response Page</title></head>
    <body>
    <%-- <jsp:useBean id="beanInstanceName" scope="session" class="package.class" /> --%>
    <%-- <jsp:getProperty name="beanInstanceName" property="propertyName" /> --%>
    Thank you... <%=request.getParameter("get_name") %>
    // I want to pass this get_name to my next page, but since request.getParameter returns an object and not a string, how will I capture the value and pass it to my next page.
    </body>
    </html>
    The 3rd jsp page is:
    <%@page contentType="text/html"%>
    <html>
    <head><title>JSP Page</title></head>
    <body>
    // I am trying to get the value of the name here in this page.
    <%-- <jsp:useBean id="beanInstanceName" scope="session" class="package.class" /> --%>
    <%-- <jsp:getProperty name="beanInstanceName" property="propertyName" /> --%>
    </body>
    </html>
    Your help is appreciated.
    Thanks

    Hi,
    Thanks for the reply, it works. I was wondering whether this is an efficient way of doing this. What I want to do further is to setup a connection to a database and use the value I got from my previous page to query the DB and get the results and display.
    I have see some code in the java website and a lot of people do by writting a bean /class(believe bean is just a class) and then importing it and do the things that way. I have good knowledge of OO and Java as a language and would definitely love to do it this way.
    What i think i am missing is the basic idea to doing this way. So if you could let me know how to do this using java classes I would really appreciate it. If its too much to explain can u point to some good source(URL's) that explain's this. I have searched on this and all i find is code with no good explaination.
    Thanks a lot

Maybe you are looking for

  • Audigy 4 Pro On Screen Display Is

    Hi! I just updated my Audigy 4 pro's drivers and apps from the Creative's web site Download section... Now ... The On Scren Display (the one that shows u the volume/mute/unmute) doesn't appear anymore! I've tried to disable it and enable it again but

  • ERMS - Email Linking works only in DEBUG mode!

    Hi All, We are on ERMS in CRM 7.0 SP04. I am facing a strange issue. I have configured a Rule Policy so that when a user send an email to a particular email id a service ticket is created. A small subset of this functionality is that the email that t

  • Exposure and colour differences when importing...

    I'll try to be brief. I shoot in NEF and upon import into LR I convert them to DNG's using the LR 'Zeroed' setting. I do expect a flat looking file but what I don't expect is a colour shift and such a flat looking file. Let me explain... if I don't c

  • PR price not copying to PO regardless of maintained parameters

    i have maintained parameters in OMET (functional authorisation) and i have selected adopt PO price i have added EFB as a parameter in SU01 and yet my PR price is not getting adopted into PO. initially in the personal settings i also choose adopt PO p

  • Excel 3D Bar Stacked

    Spoiler (Highlight to read) Hello, how can i change the Diagram (3D Bar Stacked) from horizontal barto vertical bar?  Thanks for any help Mändy  Attachments: Forum.png ‏34 KB Forum1.png ‏16 KB