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.

Similar Messages

  • 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 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?

  • 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 Multiple Parameters to SQL Script from a Shell Script

    Hi Friends,
    I have SQL script which accepts 6 parameters.
    I am calling this from a shell script as shown below:
    sqlplus -s  ${ORACLE_ID} @${SQLPATH}KORONT_041.sql ${USER_ID} ${PDC} ${item_number} ${KORDC} ${PDCSET} ${last_Updated_in_hours} Out of the six parameters, item_number is not a mandatory parameter.
    When i pass all six parameters, there is no issue.
    But when i leave item_number blank, i am getting the below error
    Enter value for 6:
    User requested Interrupt or EOF detected.Based on the error, it seems that the NULL values for item_number is ignored and SQL*PLUS is waiting for one more input from user.
    How can i overcome this issue?
    Regards,
    Sreekanth

    Hi,
    I am calling the shell script from concurrent program and below is the log file of the concurrent program.
    Copyright (c) 1979, 1999, Oracle Corporation. All rights reserved.
    KORONT_041_SH module: KORONT - Daily Item Master Update
    +---------------------------------------------------------------------------+
    Current system time is 29-JUN-2011 10:09:35
    +---------------------------------------------------------------------------+
    REQUEST_ID: 68510795
    USER_ID: 4219
    PDC:    85
    Item Number:
    KORDC:    124
    PDCSET:   1100000003
    last_updated_in_hours: 24
    EMAIL_ID: [email protected],[email protected]
    SQLPATH: /e381/oracle/asodev01appl/custom/motont/1.0.0/sql/
    RPTDIR:  /e381/oracle/asodev01comn/admin/out/ASODEV01_asoprdb2
    RPTFILE: o68510795.out
    Table truncated.
    *Enter value for 6: User requested Interrupt or EOF detected.*
    Table truncated.
    old  15:       AND ic.organization_id   = &&4
    new  15:       AND ic.organization_id   = 1100000003
    0 rows created.
    Input truncated to 9 characters
    old   8:                AND organization_id   = &&4
    new   8:                AND organization_id   = 1100000003
    0 rows created.
    End of SQL
    No record.
    +---------------------------------------------------------------------------+
    Executing request completion options...
    +------------- 1) PRINT   -------------+
    Printing output file.
                   Request ID : 68510795      
             Number of copies : 0      
                      Printer : noprint
    +--------------------------------------+
    Finished executing request completion options.
    +---------------------------------------------------------------------------+
    Concurrent request completed successfully
    Current system time is 29-JUN-2011 10:09:38
    +---------------------------------------------------------------------------+Regards,
    Sreekanth

  • Passing Value to a Angular Controller from MVC Controller Action

    Hi ,
    I have a Angular MVC Application my Angular controller code is like below.
    app.controller('SearchController', ['$scope','$http',function ($scope, $http) {
        $scope.sessionGuid = 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function (c) {
            var r = Math.random() * 16 | 0, v = c == 'x' ? r : (r & 0x3 | 0x8);
            return v.toString(16);
        $scope.searchValue = "";
        $scope.stockNumber = "";
        $scope.searchRequest = {
            Criteria: [],
            resultsTabIndex: 0,
            orderBy: "sortbypopularity",
            value:"mut" //Added
    I have a view Search.Html Which display the data on the basis of searchRequest object which is defined in Controller above.
    Now i have a requirement that i Need to show this view from MVC controller.
    Do you have any idea how can i pass value to controller which is required by the search request object  so that i can show the view with the data.
    Thanks

    Hi,
    Is it relate to SharePoint?
    Seems more like an Angular related issue, I would suggest you post this question to the corresponding forum, you will get more help and confirmed answers there.
    Best regards
    Patrick Liang
    TechNet Community Support

  • 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

  • Pass values to EXTENSIONIN or BAPIPAREX from WebDynpro

    Hi,
    I am facing problem in passing my custom field values to EXTENSIONIN (BAPIPAREX) in BAPI_PO_CREATE1. Could any one please tell me how to pass values.
    Thanks
    Vijay

    Hi lvrat,
    A control reference can be passed between VIs, as shown by this example. Additionally, this example describes how to do custom user events, and how to queue them. As far as pros/cons, I recommend passing the control reference, as this will get you the best performance.
    Cheers!
    TJ G

  • How to pass a variable into sqlplus script from file

    here is my problem :
    I have plenty of sql scripts to run. So every time I need to run sqlplus /nolog @scriptxx.name<enter> and then type login<enter>, password<enter>, second login<enter> , second password<enter> - and when it finishes again from the beggining with next one...
    I am fed up with passing these parameters every time. I would like to create a file (files?) with these logins and passwords (located f.ex. in directory where I run the script) then tells, in some way, to my scripts that answers for their questions is inside this file(s).
    Is there any way to do it in such a way ?
    something like: accept DataUser char %read from file user1.txt without my inerteraction%
    ps.
    I cannot add directly these parameters to script because I need to run them on different servers (DEVs and PRODs) and every server has different users and passwords
    KP>

    Actually the START command would resolve the issue, in conjunction with passing parameters and DEFINEs in a sensible manner.
    DEFINE dathasb = '&1'
    ACCEPT dathasb char prompt 'etc...'
    When dathasb already has a value, ACCEPT won't prompt.
    Too many people start hacking and don't use the power of Oracle because they don't the needful : Reading the documentation.
    Other than that obviously the series of scripts needs of course to be re-engineered.
    Asking interactively for a password .... even 20 years back we already didn't do this anymore.
    Of course that was the time when exporting anything beyond the VAX 11/750 to Eastern Europe was prohibited because of US export regulations ;)
    You could store the passwords in Oracle Wallet and be done with it.
    You could use OS authenticated accounts and be done with it.
    But then you still didn't post a version, even not when requested.
    Sybrand Bakker
    Senior Oracle DBA

  • 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 long string to shell script from java

    I am trying to passa a long string to a shell process through java,
    call is like
    Runtime rtime = Runtime.getRuntime();
    String callAndArgs[] = {"/apps/jetty4/jstest/jstest.sh",jarCo,queue,text};
    Process child = rtime.exec(callAndArgs);
    here the string text is :
    |HEADER|JAR933|[email protected]|290001|OL0006528|WIN4015444|SHAFT_FORGING|1.0|Baan EDM|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
    |290001|WIN4015444|00||||2|SHAFT FORGING|9|AXELSMIDE|3|ACHSE SCHMIEDEST�CK|4|ARBRE FORG�|f|AKSELITAOS|||||||||||||||||||||||No||Approved|41.0|Mechanic|Yes|pc||WIN4015444|EL20|Purchased|Metric||0|20051120|||||Released||||||||||||||||No||||||||||||||||||||||||||||||||
    Now i use this string in shell script to pass as an argument to other class. But the string gets truncated.
    How do i solve this?

    It appears that your os is truncating the data - Java's not involved.
    Maybe write the data to a file and then read it into the external program some way.

  • Passing value to a dynamic page from a pdk-java portlet

    Hi everyone.
    I'm quite new to portlets, so I'll try to present my problem as well as I can:
    I have a PDK-java portlet in which I read some information (like name, location) about user.It works ok.Now I want to use that infomation in another portlet, which is build as a Dynamic Page ( with portletbuilder). How can I do this? I was thinck at session variables, but....
    Thanks a lot

    have you ever got any response??
    i'm facing the same problem.
    thanks

  • Open a JSP page from an applet

    Hello u all!
    I am writing an applet in which I ask for a few parameters,when I have them all I�d like to open a new JSP page in another window of the web browser giving to this page all the parameters I have collected during the life of the applet. Does anybody know how can I do it? Thanks in advance.

    Hi,
    Use the showDocument method in conjunction with getAppletContext.
    And pass all ur parameters thru it.
    Lushhay

  • Passing Values back from Custom Tag

    I'm using custom tags, and I'm trying to pass back values to the JSP page from a tag which is iterating over values it gets from an Array. But for some reason I can't access the values.
    Here is the Tag:
    public class MemberHelper extends TagSupport implements IterationTag {
        private Iterator iterator;
        protected Tag parent;
        protected PageContext pageContext;
        public MemberHelper() {
            super();
        public void otherDoStartTagOperations() { 
            sfmember_prop_desc desc = new sfmember_prop_desc();
         ArrayList allt = new ArrayList();
         try {
                 allt = desc.GetAllCustom();
         } catch (java.sql.SQLException ex) {}
            if(allt.size() > 0)
             iterator = allt.iterator();

        public void otherDoEndTagOperations()  {
        public boolean shouldEvaluateRestOfPageAfterEndTag()  {
            return true;
        public int doStartTag() throws JspException, JspException {
           otherDoStartTagOperations();
           if (theBodyShouldBeEvaluated()) {
              return EVAL_BODY_INCLUDE;
           } else {
              return SKIP_BODY;
         public int doEndTag() throws JspException, JspException {
           otherDoEndTagOperations();
           if (shouldEvaluateRestOfPageAfterEndTag()) {
              return EVAL_PAGE;
           } else {
              return SKIP_PAGE;
        public int doAfterBody() throws JspException {
           if (theBodyShouldBeEvaluatedAgain()) {
              return EVAL_BODY_AGAIN;
           } else {
              return SKIP_BODY;

  • Passing values to standard screen from  an my internal

    Hi Experts,
    I want to pass values to the mb51 screen from my own internal table.
    in the program for mb51 there is include programLMIGOTV4 where what is use of following
    PBO module before start of LOOP.
    METHOD pbo.
    CALL METHOD super->pbo.
    tv_goitem-lines = lcl_migo_globals=>kernel->s_status-lines.
    ENDMETHOD.
    Also how can see the method Kernel and what is the use of that....
    Also when is the S_Status-lines update in the method Kernel.
    Please help me to understand ASAP.
    Thanks &Regards
    Tejaswini

    hi.
    You can pass values by two ways:
    1. use BDC option CALL TRANSACTION of the transaction MB51. But first you will have to see how it behaves during recording in SHDB.
    2 . Another is use
    SET PARAMETER ID 'MAT' FIELD WA_DATA-MATNR.
    CALL TRANSACTION 'MB51'.
    This would call the transaction with MB51 screen with material number initialised.
    check out   screen 1000 of prog 'RM07DOCS' for parameter id's of different fields.
    WRK- for werks
    LAG-storage location
    CHA for batch and so on.

Maybe you are looking for