How can i assign a Javascript variable to JSP variable

Hi guys
how i can assign a javascript variable to jsp expression.,
e.g.,
<input type = "button" value = "Add more" onclick = "return submitform1('<%=s%>')">
function submitform1(String s)
      var s1 = s
document.form1.action = "../intimation.do";    /* Here i want to pass the value s1 to jsp or servlets without using hidden fields and Query string*/
       document.form1.submit();
      return false;
/*  i want to pass the values thru session whether it is possible */
pls give sample code
Reply
Marimuthu

You don't have the session.
All you have is HTTP.
The only way to communicate from the client to the server is via an HTTP request. The only way to send a value like that is with a parameter.
Using a form with method="submit" as mentioned will pass the parameters without displaying them in the url bar (is that what you wanted?)

Similar Messages

  • How can we assign a JavaScript function on an TextInput action .

    Hello All ,
    I have a requirement that on ON_BLUR event of a MessageStyledText , I have to call a JavaScript function .
    This however should not refresh the page ( No submit action to the controller) .
    So how can we tie the JavaScript function to the TextInput at design time .
    Please auggest the needfull.
    Thank you,
    Srikanth

    Hi Tapash ,
    Actually my requirement was not to submit the form to controller .
    I got the solution for that . I have registered a JavaScript function to the MessageText in PR as
    pageContext.putJavaScriptFunction("callMethod","function callMethod() { var first=document.getElementById('First').value; ");
    OAMessageTextInputBean GoalTextBean2=(OAMessageTextInputBean)webBean.findChildRecursive("Second");
    GoalTextBean2.setOnBlur("callMethod()");
    Regards ,
    Srikanth

  • How can I assign javascript variables to jsp or java variables.?

    How can I assign javascript variables to jsp or java variables.?

    See I have generated some variables in the javascript which is on the jsp page. I want to assgin these variables to the jsp vaiables. Or how can I access javascript variables from jsp on the same jsp page.

  • How can I assign a hard coded value to a variable of type OBJECT.

    Hi,
       I have to call the following method
                                      lc_action_execute->get_ref_object(
                                                            exporting
                                                                  io_appl_object = io_appl_object
                                                            importing
                                                                   ev_guid_ref    = lv_guid_ref.
    Now I have to hard code the io_appl_object variable (of type OBJECT) to test my application for the time being. How can I assign a value to the variable? Is there any way to do that?

    I wouldn't use WDR_CONTEXT_ATTR_VALUE_LISTGEN.  Use wdr_context_attr_value_list instead:
    data l_topics type zpm_main_topic_tbl.
      l_topics = wd_assist->read_all_topics( ).
      data lt_valueset type wdr_context_attr_value_list.
      field-symbols <wa_topic> like line of l_topics.
      field-symbols <wa_vs>  like line of lt_valueset.
      loop at l_topics assigning <wa_topic>.
        append initial line to lt_valueset assigning <wa_vs>.
        <wa_vs>-value = <wa_topic>-main_topic.
        <wa_vs>-text  = <wa_topic>-main_topic_desc.
      endloop.
      data lo_nd_meeting type ref to if_wd_context_node.
    * navigate from <CONTEXT> to <MEETING> via lead selection
      lo_nd_meeting = wd_context->get_child_node( name = wd_this->wdctx_meeting ).
      data lo_node_info type ref to if_wd_context_node_info.
      lo_node_info = lo_nd_meeting->get_node_info( ).
      lo_node_info->set_attribute_value_set(
         name = 'MAIN_TOPIC'
         value_set = lt_valueset ).

  • How Can I Set a Javascript Value into an Attribute of BSP PAGE

    Hi
    Can anyone tell me.
    How Can I Set a Javascript Value into an Attribute of BSP PAGE

    Hi Mithlesh,
    javascript runs on client side and you cannot assign the value to a Page attribute directly.
    As a workaround,you can use an Inputfield,hidden if required,and set the value using javascript.Then the form will have to be submit to be able to read the value in onInputProcessing and then can be assigned to any variable.
    In Layout
    <head>
    <script language="javascript">
    function pass()
       txt1 = document.getElementById("ip_mrf");
       txt.value = "hello" ;
    </script>
    </head>
    <htmlb:inputField  id="ip_mrf"
                               value="<%=mrf_number%>"
                               visible="FALSE"/>
    in onInputProcessing
    cha1 = request->get_form_field( 'ip_mrf' ).
    where cha1 is the page attribute
    hope this helps,
    Regards,
    Siddhartha
    Message was edited by: Siddhartha Jain

  • I want to assign the value of a Javascript variable to JSP Variable

    I want to assign the value of a Javascript variable to JSP Variable .. for example :
    <%
    Bla Bla Bla
    %>
    <script>
    var JavaScriptVariable="hello"
    </script>
    <%
    String JSPVariable=// The Value of JavaScriptVariable ;
    %>
    How can i do that ??
    Thanks

    >I want to assign the value of a Javascript variable to JSP Variable
    cannot be done.Friend try to understand concepts properly Javascript is always excuted by the browser @clientside where as JSPCode is executed Websever(ServletContainer) @serverside.Through you are combining JSP Code blocks(Tags,Expressions,scriptlets...) & javascript under a single page webserver can only identify what is their under JSP Code blocks.
    Hope this could be an appropriate answer for your question.
    However,you can as well submit a request by encoding your URL with request parameters and the submit to the page and then collect it using request.getParameter(name).
    But under a single context state it is not possible
    REGARDS,
    RaHuL

  • How can I assign image file name from Main() class

    I am trying to create library class which will be accessed and used by different applications (with different image files to be assigned). So, what image file to call should be determined by and in the Main class.
    Here is the Main class
    import org.me.lib.MyJNIWindowClass;
    public class Main {
    public Main() {
    public static void main(String[] args) {
    MyJNIWindowClass mw = new MyJNIWindowClass();
    mw.s = "clock.gif";
    And here is the library class
    package org.me.lib;
    public class MyJNIWindowClass {
    public String s;
    ImageIcon image = new ImageIcon("C:/Documents and Settings/Administrator/Desktop/" + s);
    public MyJNIWindowClass() {
    JLabel jl = new JLabel(image);
    JFrame jf = new JFrame();
    jf.add(jl);
    jf.setVisible(true);
    jf.pack();
    I do understand that when I am making reference from main() method to MyJNIWindowClass() s first initialized to null and that is why clock could not be seen but how can I assign image file name from Main() class for library class without creating reference to Main() from MyJNIWindowClass()? As I said, I want this library class being accessed from different applications (means different Main() classes).
    Thank you.

    Your problem is one of timing. Consider this simple example.
    public class Example {
        public String s;
        private String message = "Hello, " + s;
        public String toString() {
            return message;
        public static void main(String[] args) {
            Example ex = new Example();
            ex.s = "world";
            System.out.println(ex.toString());
    }When this code is executed, the following happens in order:
    1. new Example() is executed, causing an object to constructed. In particular:
    2. field s is given value null (since no value is explicitly assigned.
    3. field message is given value "Hello, null"
    4. Back in method main, field s is now given value "world", but that
    doesn't change message.
    5. Finally, "Hello, null" is output.
    The following fixes the above example:
    public class Example {
        private String message;
        public Example(String name) {
            message = "Hello, " + name;
        public String toString() {
            return message;
        public static void main(String[] args) {
            Example ex = new Example("world");
            System.out.println(ex.toString());
    }

  • How can I assign a action to a button of the many scripts in the script file.

    How can I assign one action of many actions in a script file.
    I have many actions in a script file and I want to run one of them by clicking a button on the panel. However, loading the script I can not isolate the action that interests me.

    Hello,
    Try System Preferences>Energy Saver>Options tab, uncheck Allow power button to sleep computer.
    Some possible other options...
    Control-Eject
    The dialog box "Are you sure you want to shut down your computer now?" appears with options to Restart, Sleep, Cancel or Shut Down. After the dialog appears, press the R key to Restart, press the S key to Sleep, press the Esc key to Cancel, or press the Return key to Shut Down.
    Control-Command-Eject
    Quits all applications (after giving you a chance to save changes to open documents) and restarts the computer.
    Control-Option-Command-Eject
    Quits all applications (after giving you a chance to save changes to open documents) and shuts the computer down.
    Command-Option-Eject
    Puts the computer to sleep.
    Shift-Control-Eject
    Puts all displays to sleep.
    Power button (if the computer is not responding)
    Press and hold the power button on the computer for six seconds to shut down the computer.
    http://support.apple.com/kb/ht2448

  • How can we assign one attribute set to multiple business partners at a time ?

    How can we assign one attribute set to multiple business partners at a time ? Is it possible ? Can anyone explain me ?

    Hello,
    please refer to the following thread:
    How can we assign one Attribute Set to multiple Business Partners at a time? Is it possible?
    best regards,
    Johannes

  • How can we assign different colours to different records(line items) in alv

    how can we assign different colours to different records(line items) in alv reporting?

    Hi Friend,
    Please see this SDN Wiki  for setting the color in ALV :[http://wiki.sdn.sap.com/wiki/display/ABAP/ABAP-DevelopingInteractiveALVReportusing+OOABAP]
    There are so many SDN Wiki's on this  just try with search  Alv Color display in SDN,
    Regards,

  • How can we assign sproxy generated objects to a different package?

    Hello Expert,
    We need to change the package assigment of sproxy generated DDIC objects. How can we assign sproxy generated objects to a different package?
    Regards,
    Thulasi

    Any idea?

  • How can i assign an identifier to a movieclip using AS2 ???

    Hey guys, i'm using the scrolling pane component in my
    project. i used to enter in the content path, the identifier of the
    movieclip which i set through the library. But now i wanna give it
    a movie clip that i've created in my code...so how can i assign an
    identifier to a movieclip using AS2 so that i can use it with my
    componenets ???? THANX

    I'm trying to make a script that goes through a folder recursively, checks for every folder if it's name is "template", and if so it changes the icon of that folder to an icon
    I chose.
    I searched for an answer here, and I've only managed to find a way to assign an icon to a shortcut, but not to an existing file.
    Thanks in advance (:

  • How can I assign an icon to a folder using Powershell?

    How can I assign an icon to a folder using Powershell?

    I'm trying to make a script that goes through a folder recursively, checks for every folder if it's name is "template", and if so it changes the icon of that folder to an icon
    I chose.
    I searched for an answer here, and I've only managed to find a way to assign an icon to a shortcut, but not to an existing file.
    Thanks in advance (:

  • How can I assign a period (instead of B) in Keynote for blank screen so I can use a Logitech R800 presenter? An option in next version?

    I have recently bought a Logitech R800 presenter which works very well with Keynote on a MacBook Pro. The start/stop presentation key does not work but that can be easily fixed by assigning F5 to "Start presentation" for Keynote in the keyboard system preferences. The remaining issue is that the blank screen button sends a period (".") which works as a prompt for a blank screen in PowerPoint, but in Keynote it causes the slideshow to end. Keynote uses the letter "B" for blank screen.
    How can I assign a period (instead of B) in Keynote for blank screen? Some sort of work around would be very useful as I often use blank screen in my presentations and much prefer Keynote to PowerPoint.
    Perhaps it will be an option in next version of Keynote?
    Thanks

    As far as I know you can not change these keystrokes without changing the Program files. I am sure it is possible there, but I have no idea where to even start to tell you where to find it.
    Your best bet it to go to the Keynote Menu>Provide Keynote Feedback and let Apple know you would like the option to change them.

  • Purchased CC for business and can only assign one user. How can I assign more users to have it on all 4 computers in the office?

    Purchased CC for business and can only assign one user. How can I assign more users to have it on all 4 computers in the office?

    Hi there
    You would need to purchase a seat for each user.
    What you currently have is 1 seat = 1 user.
    Kind regards
    Bev

Maybe you are looking for

  • Bank Interest Calculation on Opening and Closing Balance

    Hi Experts, I have quiry on bank interest calculation. when was run F.52, giving one months (01.04.2008 to 30.04.2008) calculation period that time system calculate interest from 01.04.2008 to 30.04.2008. System calculate interest on Balance Carryfor

  • OBIEE 11g - Data Fetch Issue.

    Hi, I am facing this weird issue regarding data fetching while executing Reports in OBIEE 11.1.1.5. When I login to the BI user interface and execute any report for the first time, everything is working fine. Bt after that I am not able to execute an

  • Error while importing DELVRY01 Idoc in R/3

    Hello @ all, Via XI I'm mapping a XML-File to an DESADV.DELVRY01 idoc. When the idoc is received by the R/3 System, the Idoc gets passed to the application, and it get the status 51 with the message: Enter either delivery date or goods issue date. Do

  • Is there a google-hangout plugin for arch ?

    Hi Sorry if this is a dumb question, but is the google-talk plugin in AUR the same as the hangouts plug-in available as an RPM or DEB at https://www.google.com/tools/dlpage/han - nload.html If not anyone know if there is a package for hangouts? I hav

  • Problem with applying filter?

    Hello All,   I am facing problem with filter.   I am developing a smart sunc application using   following BAPIs.        GetList          MEREP_CONTACT_GETLIST                GetDetail        MEREP_CONTACT_GETDETAIL              Create           MERE