Passing parameter values to jsp

hi i have got a slight probelm that my jsp doesnt print out teh value that is being to it from teh wml
my wml file is:
<b><big> Subject:</big></b>
                         <input type ="text" name="srch" height="20" format="*X,*x"/>
                         <do type="accept" label="Search">
                         <go href="http://localhost:8080/srch2.jsp" method="post">
                         <postfield name="Subject" value="$srch"/>
jsp:
<?xml version="1.0" encoding="utf-8"?>
     <!DOCTYPE wml PUBLIC "-//WAPFORUM//DTD WML 1.3//EN"
          "http://www.wapforum.org/DTD/wml13.dtd">
<%@ page language="java" contentType="text/vnd.wap.wml"%>
<wml>
<card id="srch" title="Search">
     <p>
          <%
               String Search;
               Search=(String)request.getParameter("srch");
               out.println("<br/>Search is"+Search);
          %>
          </p>
     </card>
the reulst i get is Search isnull, where is the probelm?
thank you very much

hi thanks for replying
my form is here:
<?xml version="1.0" encoding="utf-8"?>
     <!DOCTYPE wml PUBLIC "-//WAPFORUM//DTD WML 1.3//EN"
          "http://www.wapforum.org/DTD/wml13.dtd">
<wml>
     <card id="search" title="Search">
               <p align="left">
                    <fieldset title="subject">
                         <b><big> Subject:</big></b>
                         <input type ="text" name="srch" height="20" format="*X,*x"/>
                         <do type="accept" label="Search">
                         <go href="http://localhost:8080/srch2.jsp" method="post">
                         <postfield name="Subject" value="$srch"/>
                         </go>
                         </do>
                    </fieldset>     
               </p>
     </card>
</wml>
would you be bale to tell what is worng anfd why it doesnt print?
thank you

Similar Messages

  • Syntax to pass parameter value to jsp using href in out.println

    Hi,
    I have the URL in the form as mentioned below:
    <a href="b2c/marketing/showDocDetail.jsp"> <%=doc_no%></a>
    I've created the hyperlink using href tag to the document number in the jsp using the below syntax.
    <% String a1 = "Document ";
           String a2 = "<a href=\"";
           String a3 = "marketing/showDocDetail.jsp\">";
           String a4 = doc_no;
           String a5 = "</a>";
    out.println(a1a2a3a4a5);
    %>
    When clicked the doc_no is passed to backend RFC and export parameter is retrieved to result.jsp where values along with doc_no are displayed.
    the value after clicked is not being passed to action.java class that does the retreival.
    Needful, backend class, bom, entry in config.xml is all maintained.
    Please help me out with the syntax to pass the parameter value into java class

    Hi Bharathi,
    try below.
    <%
           String a1 = "Document ";
           String a2 = "<a href=\"";
           String a3 = "marketing/showDocDetail.do?docNo=";
           String a4 = doc_no;
           String a5 = " \">";
           String a6 = doc_no;
           String a7 = "</a>";
    out.println(a1+a2+a3+a4+a5+a6+a7);
    %>
    I assume doc_no is java variable contains value of document number
    Now create action entry in config.xml file. Suppose "actionDoc.java" class process it.
    <action path="/marketing/showDocDetail" type="com.xyz.actions.actionDoc">
                   <forward name="success" path="/marketing/showDocDetail.jsp"/>
                   <forward name="error" path="/marketing/showDocDetail.jsp"/>
    </action>
    We are passing parameter docNo=doc_no to action class actionDoc.java in this class you can retrieve request parameter docNo from request object and then process it as you want.
    Let me know if you face any problem or error.
    eCommerce Developer
    Edited by: Ecommerce Developer on Nov 9, 2009 8:35 AM

  • Passing JavaScript value to Jsp

    Hi,
    Any idea how to pass a value from javascript to jsp page when the page gets load on browser.
    I use below code but an event is require to pass the value. Is there any code that pass automatically the value from javascript to jsp.
    <html>
    <head>
    <title>Passing Javascript value to Jsp</title>
    <script type="text/javascript" language="javascript">
    var scriptVar = "Noy"
    var WinNetwork = new ActiveXObject("WScript.Network")
    document.write (WinNetwork.username)
    document.index.hiddenTextBox.value = WinNetwork.username
    </script>
    </head>
    <%
    String jspVar = null;
    if(request.getParameter("submit") != null){
         jspVar = request.getParameter("hiddenTextBox");
         out.println("Jsp Var : " + jspVar);
    %>
    <body>
    <form name="index" onSubmit="index.jsp" method="post">
    <input type="hidden" name="hiddenTextBox"><br>
    <input type="submit" name="submit" value="Submit">
    </form>
    </body>
    </html>
    Thanks,
    ~ukbasak

    JSP/Java runs at the server side, produces a HTML page, sends it to the client side and then stops running.
    HTML, containing under each CSS and JS, arrives at the client side and runs at the client side only.
    To invoke JSP/Java using HTML you need to fire a request to the server side. That can be either a plain vanilla <a> link, a <form> to be submitted or an asynchronous Ajaxical request.
    That said, the use of ActiveX in web applications is discouraged. It's a Microsoft IE proprietaty. With other words, it isn't and won't be supported by all alternative browsers which the other half of the world is using.

  • How to pass parameter to intro.jsp page ?

    Hi all,
    Anybody please tell me how to pass parameter to intro.jsp page.
    Is there any param name defined in <forward > syntax ?
    I have made following configuration in struts-config.xml file.
    I want to pass parameter to intro.jsp page
    <global-forwards>
              <forward name="invalidsession" path="/intro.jsp" redirect="true" />
    </global-forwards>
    please reply soon.
    Thanking you.

    Hi all,
    I have a similar kind of question..
    Iam trying to pass a string variable from JSP to servlet thro URL..
    Im using tomcat5
    COde:
    String fname=request.getParamter("filename");
    <jsp:forward page="/servlet/coreservlets.filedownload?name=" +fname />
    It is generating a unterminated tag error..Please help..

  • Passing JavaScript values to JSP variables

    Can any body correct the follwing code
    <Script language="JavaScript">
    function test( x )
    <%
    int num = x;
    num = num * 2;
    %>
    v.value = "<%out.print(num);%>";
    <input type="button" name="b" value="test" onClick="test(5)">
    <input type="text" name="v" value="0">
    In short, I am trying to pass JavaScript value to JSP variable. I hope that it is possible to do that. If it is possible then how can I do it. I want to assing the variable x passed to the JavaScript function called test to the JSP variable called num.
    Regards,
    Ageel

    Thank you for your reply,,,
    I think then the only way to do it is to post the
    value on the server and then use request.getParameter
    method in jsp code
    but the question now how can I post values to the
    server using JavaScript without reloading the pageyes... you can to it by create a new popup window which will submit the value to server after page was loaded... then, server return a value to the same window in html/jsp page which then using javascript to set it back to the opener and close up the window... however, this is not a good choice unless you have no other alternative...
    >
    There is other possible solution
    if I can get the text field value from the same page
    without reloading it that would work fine and will
    solve my problem, is it possible?yes... you can get the value from the textfield...
    for example :
    function showValueInTextField()
        alert(document.forms[0].elements["mytextfieldname"].value);
    >
    My final question> can jsp change things on the same
    page without reloading it. I mean can it work like
    JavaScript so that I can use it's internal functions
    instead of using java script :S
    not really know what you trying to say here...

  • To pass parameter values to the object reference of action step in sequence file of teststand programatically using C#.

    //Initialize the Engine
                EngineClass myEngine = new EngineClass();
                myEngine.LoadTypePaletteFilesEx(TypeConflictHandlerTypes.ConflictHandler_Prompt, 0);
                Step myStep = myEngine.NewStep(AdapterKeyNames.DotNetAdapterKeyname,StepTypes.StepType_Action);
                myStep.Name = "object";
                DotNetModule dotnetmodule = myStep.Module as DotNetModule;
                dotnetmodule.SetAssembly(DotNetModuleAssemblyLocations.DotNetModule_AssemblyLocation_File,@"C:sequence.dll");
                dotnetmodule.ClassName = "CN";
                dotnetmodule.MemberType = DotNetModuleMemberTypes.DotNetMember_GetProperty;
                dotnetmodule.MemberName = "ISI";  
    mySequence.Locals.NewSubProperty("object", PropertyValueTypes.PropValType_Reference, false, "", 0);        
    Sequence mySequence = myEngine.NewSequence();
                mySequence.Locals.NewSubProperty(varName, PropertyValueTypes.PropValType_Reference, false, String.Empty, 0);
    mySequence.InsertStep(myStep, 0, StepGroups.StepGroup_Main);
                SequenceFile seqFile = myEngine.NewSequenceFile();
                seqFile.InsertSequence(mySequence);
    seqFile.Save("C:\\mySeq.seq");
    I have done this,dynamically creating a sequence file in teststand programatically through c#.
    Problem is
    1.I created an action step and object Reference variable for the step, but i am not able to pass  parameter values to the objectReference 
    2.I am not able to load the sequence in to the main Sequence of the sequence file in the teststand. How can I do these two things.

    Hi,
    have you ever followed on my Links ?!?!?
    If not please jump to this one
    http://forums.ni.com/ni/board/message?board.id=330&thread.id=26880 
    and read the the answer from Mannoch
    starting with this words:
    Anthony -
    Currently, functionality for retrieving the Metadata Token for a class constructor or member is not fully provided in the TestStand .NET Adapter API. The DotNetModule.GetConstructorMetadataToken() and DotNetModule.GetMetadataToken() methods only return the correct Metadata Token when the member/constructor prototypes have already been loaded. Thus, in the case of your code, when you call DotNetModule.GetMetadataToken(), the method is returning -1 because the member prototype for the Step you are referring to has not yet been loaded.
    That means have to do a workaround for your stuff.
    Juergen
    =s=i=g=n=a=t=u=r=e= Click on the Star and see what happens :-) =s=i=g=n=a=t=u=r=e=

  • Passing Parameter  values

    Hi,
    Iam trying to print a crystal report, but it is not prompting me to pass the parameter values.
    i want  user to pass parameter values.
    Iam using VB.Net code to generate the reports.
    Could plz help me
    Thanks
    Ravi

    assuming v_seqprocess_id takes the process_id, I'd probably go with something like:
    cursor sum_cur(p_process_id number) is
    select sum(cheque_amt), sum(balance)
    from   table
    where  process_id = p_process_id;and call the cursor passing v_seqprocess_id into it.
    That's if I had to do extra processing on top of getting the values, etc.
    Otherwise, I'd go with:
    insert into table2
    select sum(cheque_amt), sum(balance)
    from   table
    where  process_id = v_seqprocess_id;Message was edited by:
    Boneist
    Added in the insert version

  • Passing javascript values to jsp without refreshing the page

    Hi,
    How do u pass a value of a javascript variable to the jsp without refreshing the page ?
    For example, a file called test.jsp in which a javascript variable x contains value 254. I need to pass the value of x to a method declared in test.jsp(same page).

    Hi Mona,
    when i say refresh i do mean a blink of the browser.
    This is a small example i wrote to show you how you can pass javascript varables to JSP variables. If you don't want the refresh to be seen by the user just include this code in a hidden frame on a page and instead of refreshing the entire page, refresh the hidden frame.
    i have to say, i didn't test the code so i don't guarantee it's flawless.
    if you need an more detailed example just tell me, i'll create one, but it won't be for today :)
    <html>
    <head>
         <title>Log in to the system</title>
    </head>
    <body>
    <script>
    //we retrieve the parameter 'user' from the URL
    <%
      String username = request.getParameter("user");
    %>
    var user = "<%= username%>";
    //check if there is a username in the URL
    if(user=="null")
      //there is no username so we log the person in as a guest
      user="guest";
      //we refresh the page and set the user parameter to 'guest'
      //the parameter now contains the javascript variable 'user'.
      //The parameter can be read by the JSP (see the top op this script).
      //This way we gave the javascript variabele to the JSP variable
      location="login.jsp?user="+user;
    else if(user=="guest")
    {  alert("Welcome "+user+", I hope you like this site"); }
    else
    {  alert("Welcome "+user+", I'm glad to see you again"); }
    </script>
    </body>
    </html>

  • Passing parameter value to embedded content.

    hi
    i am designing a dash board in which i pass a value (say id) from before screen. and in the next screen i displayed the value using narrative view.. now in the next section i have to embed a JSP page by passing that id as a parameter.....
    how to achieve this...........
    thanks
    Bala.

    Post Author: SKodidine
    CA Forum: Formula
    If you want to print the dates then you do not need variables, just create a formula with the following and place the formula in the report:
    "Date Range: " & minimum({?date range parameter}) & " to " & maximum({?date range parameter});

  • How to pass parameter between two jsp pages using web link (not form)

    Hi Friends,
    I have two jsp pages and would like to pass a parameter from one JSP page (one.jsp) to another JPS page (two.jsp)
    in one.jsp
    <a href="two.jsp?ant="<%=ant%">"> <%=antName%> </a><br>
    I don't know how to pass value of parameter "ant" to two.jsp from one.jsp.
    Can anyone help this? Thank you in advance</a>

    Looks like you've got it almost right - just an extra unneeded "
    <a href="two.jsp"?ant=<%= ant %>"><%=antName%></a>
    which should render on the page as something like
    My Ant Task
    When you click the link, it should pass that parameter, and you can get it via request.getParameter().

  • Passing parameter to custom JSP page

    From an appraisal, I am adding a link thru personalization that opens a custom JSP page in a new window. I somehow need to pass the appraisal_id context from the old page to the new page so the new page displays the appropriate information.
    This is tricky because the original appraisal page isn't calling the new page within its code. Is there any way possible to pass a parameter such as appraisal id to this new page?
    Thanks for any help.
    M

    M,
    Have you tried passing the value via HTTP session.
    Thanks.
    With Regards,
    Kali.
    OSSI.

  • Passing parameter values to powershell function from batch file

    Hello ,
       I haven't used powershell for a while and getting back to using it. I have a function and I want to figure out how to pass the parameter values to the function through batch file.
    function Check-FileExists($datafile)
    write-host "InputFileName : $datafile"
    $datafileExists = Test-Path $datafile
    if ($datafileExists)
    return 0
    else
    return -100
    <#
    $datafile = "C:\Dev\eMetric\PreIDWork\PreIDFiles\SampleInputFile_011.txt"
    $returncode = Check-FileExists -datafile $datafile
    Write-Host "ReturnCode : $returncode"
    $datafile = "C:\Dev\eMetric\PreIDWork\PreIDFiles\SampleInputFile_01.txt"
    $returncode = Check-FileExists -datafile $datafile
    Write-Host "ReturnCode : $returncode"
    #>
    The above code seems to be work when I call it. But when I try to call that script and try to pass the parameter values, I am doing something wrong but can't figure out what.
    powershell.exe -command " &{"C:\Dev\eMetric\PreIDWork\PowerShell\BulkLoad_Functions.ps1" $returncode = Check-FileExists -datafile "C:\Dev\eMetric\PreIDWork\PreIDFiles\SampleInputFile_01.txt"}"
    Write-Host "ReturnCode : $returncode"
    $file = "C:\Dev\eMetric\PreIDWork\PreIDFiles\SampleInputFile_01.txt"
    powershell.exe -file "C:\Dev\eMetric\PreIDWork\PowerShell\BulkLoad_Functions.ps1" $returncode = Check-FileExists -datafile $datafile
    Somehow the I can't get the datafile parameter value being passed to the function. Your help would be much appreciated.
    I90Runner

    I am not sure about calling a function in a script like how you want to. Also I see you are setting the values of the parameters, this is not needed unless you want default values if nothing is passed. The values for the parameters will be passed via the
    batch file. So for me the easiest way is as indicated.
    param
    [string]$DataFile
    function Check-FileExists($datafile)
    write-host "InputFileName : $datafile"
    $datafileExists = Test-Path $datafile
    if ($datafileExists)
    return 0
    else
    return -100
    Write-Host "Return Code: $(Check-FileExists $DataFile)"
    Then you create a batch file that has
    start powershell.exe
    -ExecutionPolicy
    RemoteSigned -Command
    "& {<PathToScript>\MyScript.ps1 -DataFile 'C:\Dev\eMetric\PreIDWork\PreIDFiles\SampleInputFile.txt'}"
    Double click the batch file, and it should open a powershell console, load your script and pass it the path specified, which then the script runs it and gives you your output
    If you find that my post has answered your question, please mark it as the answer. If you find my post to be helpful in anyway, please click vote as helpful.
    Don't Retire Technet

  • How can i pass parameter values from html to a shell script

    Hi Guys...
    I had a requirement where i need to execute a sql statement and print the output in HTML page. This report has parameters to enter. So i created a HTML form which accepts parameters. When the submit button is pressed, the action tag in the form invokes unix shell script file. It will open sqlplus and run the sql script file .sql and print the output in the HTML page.
    sql script contains the query and some set options which prints the output in HTML page. Like "SET MARKUP HTML ON"... The query has some parameters like "select * from emp where empno = &&empnumber. I will use the same name "empnumber" while created the HTML parameter form like " <input type = "text" name="empnumber" size="10" align="left">.
    user sees this parameter form and enters some value in to that empno text box.
    My question is how can i catch these parameter values in a shell script and pass it to the sql script to execute it.
    Help Appreciated
    Thanx

    This is a A Bad Idea (tm). This type of CGI processing is old and were (and still is) full of security holes. Very easy to inject stuff (Unix commands and SQL) into it.. To get those parameters into SQL*Plus requires using Unix shell commands to process it - and something like a backquote allows all kinds of nasty stuff to be injected. The Unix shell was never designed to be used as a secure CGI environment.
    There are far better and far superior alternatives. Perl (with Perl_DBI) and PHP (using Zend Core for Oracle) come to mind as web scripting languages.
    Even easier is using HTMLDB. Very few moving parts. Is free. Supports Oracle 9.2 and 10G.

  • How to pass parameter to my jsp apge included in adf inlineframe

    Hi,
    I would like to know how could i pass parameter to my adf inileframe src.
    Because when i try to do this
    <af:inlineFrame id="if1" source="/frontBackOffice/Scanning.jsp?param0=#{....}&param1=#{....}" />
    I have a error
    ADF_FACES-30179:Pour plus d''informations, consultez le journal d''erreur du serveur à une entrée commençant par : l''élément UIViewRoot est NULL. Exception fatale lors de PhaseId : RESTORE_VIEW 1
    Could you help me please

    you map the source to a backingbean.. and in the bean you just manipulate the parameters..
    chk this link for an idea - search for af:inlineframe
    http://biemond.blogspot.com/2009/02/facebook-adf-task-flow.html
    <af:inlineFrame source="#{FaceBook.facebookLoginUrl}" 
                         inlineStyle="width:99%; height:99%;" 
                         shortDesc="Loginpage"/> 
    in the bean do this
    private String facebookLoginUrl;
    public String getFacebookLoginUrl() { 
          if (sessionID==null){ 
            try { 
                  client = new FacebookJaxbRestClient(APIKEY, SECRET); 
                  token = client.auth_createToken(); 
                  facebookLoginUrl= "http://api.new.facebook.com/login.php?api_key=" + APIKEY + "&v=1.0&auth_token=" + token; 
             } catch (FacebookException ex) { 
              ex.printStackTrace(); 
          return facebookLoginUrl; 
      }

  • How to pass parameter values to a customer exit web item (WAD)

    Hi gurus,
    I have a wad with a data provider and a filter panel filtering that dp by using a variable. There is also a customer exit which saves the values of that variable into a z table.
    How can I pass the values of the filter panel to the customer exit web item?
    Thanks in advance,
    Rob

    Can you clarify your scenario? Which is the case you're talking about?
    1) You want to pass a parameter from OmniPortlet to a PL/SQL procedure.
    2) You want to pass a parameter from a PL/SQL procedure to OmniPortlet.
    In both cases the most obvious way of doing it is through request (URL) parameters.
    Render a link in your portlet (either in OmniPortlet or using PL/SQL) that invokes a portal page, containing the other portlet.
    Both OmniPortlet and PL/SQL allow you to wire and access page parameters.
    Take a look at the Using Parameter and Events section of the Portal User's Guide and the Parameters and Events section of the Portal Developer's Guide.
    Hope this helps,
    Peter

Maybe you are looking for