Use Action to call JSP method instead for forwarding to another url

I have a servlet button to save data I have entered on a form. The only way I understand to save the data when the button is pressed is to use ACTION and call up a .jsp to do the work like this:
<FORM ACTION="http://localhost:8080/examples/jsp/learningJSP/UpdateStudentInfo.jsp" METHOD="POST">
and here's the .jsp that sets my current properties from the form and saves them.
<HTML>
<BODY>
<jsp:useBean id="studentDataBean"
     class="learningservlets.StudentDataBean"
     scope ="application"/>
<jsp:setProperty name="studentDataBean" property ="*" />
<!--call saveData() to send the data you just set - to the database%=stuInfo.saveData()%>-->
<%studentDataBean.saveData();%>
<jsp:forward page="PresentStudentData.jsp" />
<H1>
UpdateStudentInfo Bean
</H1>
</BODY>
</HTML>
The problem I have with using this approach is my user is sent to another page. Is there anyway to complete the above task transparently (i.e. without making the user go to the page that does all of the work)?
Thanks for any assistance you may offer.

Use this,
UpdateStudentInfo.jsp
<%@ page import="learningservlets.StudentDataBean" %>
<jsp:useBean id="studentDataBean"
class="learningservlets.StudentDataBean"
scope ="application">
<jsp:setProperty name="studentDataBean" property ="*" />
</jsp:useBean>
<!--call saveData() to send the data you just set - to the
database%=stuInfo.saveData()%>-->
<%
studentDataBean.saveData();
response.sendRedirect("PresentStudentData.jsp");
return;
%>
Hope this helps.
Sudha

Similar Messages

  • UIX : Data action doesnt call a method

    hi,
    1)I have created two uix pages u1 and u2
    2)I have created a data action(a1) based on method(findinvoices)
    3)I have created farward from u1 to data action(a1)
    4)I have created another farward from data action(a1) to u2
    5)I method to accept the params which i defined in u1 and execute the method which i draged and dropped on action(a1)
    Note i have defined the param values for each param of data action(a1).
    Why data action(a1) is not calling the method instead it directly goest to u2 and execute the query on it.
    Thanks.

    Hi Shay,
    I have one problem because how can I create a JSP Page to display Method Results in JDeveloper10.1.3???
    I already created another page and tried to Drag and Drop my Method from Data Control Palette, but I only have the choice to create a button and I would like to see the result.
    Adding a c:out tag to the JSP page.
    Can you help me with this problem??
    Thanks,
    Micaela

  • How to Use synchronous RFC calls during test run for remote accesses

    there is a Setting for the usage of RFC accesses from a tested system
    using eCATT.
    'X' - Use asynchronous RFC calls during test run for remote accesses
    ' ' - Use synchronous RFC calls during test run for remote accesses
    I developed an eCATT as following :
      SAPGUI ( SAPGUI_1 , Target_system_1 ).
      SAPGUI ( SAPGUI_2 , Target_system_2 ).
    My question is how to run the eCATT in a synchronous RFC calls
    PS: I do not want to change the Target_system to the same one in the
    above script of ecatt.Because I need to run it in 2 different Target
    systems sometime.
    for example, I give a Target_system_3 when run this eCATT
    I want the SAPGUI_1 and SAPGUI_2 run the Target_system_3 but not the
    Target_system_1 or Target_system_2 .
    Could you please tell me how to make it without the changes in script?
    Edited by: Weitong Liu on Mar 24, 2011 9:44 AM

    Hi Liu,
    Weitong Liu wrote:
    > ' ' - Use synchronous RFC calls during test run for remote accesses
    This is the standard option value. Asynchronous are not the standard way and used only for very special purposes.
    Weitong Liu wrote:
    > I developed an eCATT as following :
    >   SAPGUI ( SAPGUI_1 , Target_system_1 ).
    >   SAPGUI ( SAPGUI_2 , Target_system_2 ).
    > My question is how to run the eCATT in a synchronous RFC calls
    The commands will be executed in sequence. So each call will be synchronously replayed against TS1 and TS2.
    What is you issue with this standard procedure?
    Kind regards,
    Christoph

  • Calling a method of one class from another withing the same package

    hi,
    i've some problem in calling a method of one class from another class within the same package.
    for eg. if in Package mypack. i'm having 2 files, f1 and f2. i would like to call a method of f2 from f1(f1 is a servlet) . i donno exactly how to instantiate the object for f2. can anybody please help me in this regard.
    Thank u in advance.
    Regards,
    Fazli

    This is what my exact problem.
    i've created a bean (DataBean) to access the database. i'm having a servlet program (ShopBook). now to check some details over there in the database from the servlet i'm in need to use a method in the DataBean.
    both ShopBook.java and DataBean.java lies in the package shoppack.
    in ShopBook i tried to instantiate the object to DataBean as
    DataBean db = new DataBean();
    it shows the compiler error, unable to resolve symbol DataBean.
    note:
    first i compiled DataBean.java, it got compiled perfectly and the class file resides inside the shoppack.
    when i'm trying to compile the ShopBook its telling this error.
    hope i'm clear in explaining my problem. can u please help me?
    thank u in advance.
    regards,
    Fazli

  • Using AJAX to call a method of controller.

    I am working with weblogic 10.2 .I need to call a method of the controller using Ajax (because i don't wan to refresh the whole page).
    I am new to Ajax.
    Can any one provide me the stub or prototype for calling a method of contoller from jsp using AJax.

    Another approach, if you would like to call a Pageflow action and then update only a portion of a portlet with the result, would be to use the Dynamic Content taglib.
    http://download.oracle.com/docs/cd/E13155_01/wlp/docs103/javadocjsp/commonui/dc/tld-summary.html
    Edited by: Brad Posner on Jan 12, 2009 10:42 AM

  • SSRS 2008 R2 - Using Action to call a report with MultiValue Parameters

    I have a report uses project names as parameter(Multi value) and display some data. I want to call this report from some other report on a click (drill down). This report has a program row where it aggregates the data, underneath Programs, I have
    list of projects(group). When I use Action on the individual projects, it takes me to the appropriate project ( I used
    Fields!ProjectName.Value). However, when user clicks on the program, it should pass the group of projects within that program to the called report. With expression,  Fields!ProjectName.Value, it only select one random project (may be first/last from
    the query) and display records. I tried Join(Fields!ProjectName.Value, ",") and Fields!ProjectName.Value(0) but now it doesn't select a sengle project. Can someone help please?

    use In instead =

  • Error while updating data using session and call transaction method

    Hi all,
        i have to update data using MM01 transaction from flat file to database.i have used both session method and call transaction method to do that.in both the methods data has been transferred from internal tables to screens but while updating the data that is by clicking the ok-code at the end of the transaction iam getting a dialogue box stating
       SAP EXPRESS DOCUMENT "UPDATE WAS TERMINATED" RECEIVED FROM AUTHOR "SAP".
      please tell whether the problem lies and solution for that.
                                       thanks and regards.

    hi,
    check your recording.check whether u saved your material no in recording or not.
    once again record the transacton mm01.
           MATNR LIKE RMMG1-MATNR,
           MBRSH LIKE RMMG1-MBRSH,
           MTART LIKE RMMG1-MTART,
           MAKTX LIKE MAKT-MAKTX,
           MEINS LIKE MARA-MEINS,
           MATKL LIKE MARA-MATKL,
           BISMT LIKE MARA-BISMT,
           EXTWG LIKE MARA-EXTWG,
    these are the fields which u have to take in internal table.
    this is the record which i took in my flatfile.use filetype as asc and hasfieldseperator as 'X'.
    SUDHU-6     R     ROH     MATSUDHU     "     001     7890     AA
    i did the same.but i didn't get any error.

  • Using Parentheses to Call a Method?

    So my code looks like this:
    DATA: o_ztransload_tools TYPE REF TO zcl_transload_toolbox.
               CREATE OBJECT o_ztransload_tools.
             o_ztransload_tools->zzcreate_date_range( zzobjin_dtlw    = zzin_dtlw
                                                      zzobjin_dthigh  = zzin_dthigh )  .
    This class method returns a date range. I would like to understand how to write this code without using the 'IMPORT' 'EXPORT' , parameter identifiers...if possible., and just using parentheses, as a shorthand way of writing the call method. So, from what I've read, it is possible to write the code this way.But when I try to add code for the single returning value, I get syntax errors.  How should the code be written for the method's returning value to be syntactically correct?
        Thank-You, Tom

    There would a several different combinations you may have to use depending on the type of parameters.
    If you have a single RETURNING parameter and single IMPORTING parameter, you can receive the results in that variable directly. Llike:
      lv_Day = zcl_Test=>give_day( sy-datum ).
    If you have multiple Importing parameters, you call the method like:
    zcl_test=>get_data(
      io_data = o_data
      io_data2 = o_data ).
    You can also set the the preferred parameter, when you have more than one importing parameter. Like IO_DATA and IO_DATA2. If make the preferred parameter as the IO_DATA2, than you can use pass this parameter without specifying parameter name.
      zcl_test=>get_Data( o_data_second ).
    If you have importing, exporting, changing parameters; than you have to explicitly mention the word EXPORTING, IMPORTING ... etc to let the system know what to change
      zcl_test_alv=>factory(
        EXPORTING
          iv_alv_type = alv_1
        IMPORTING
          eo_alv = me->o_alv
        changing
          ct_Data = t_Data ).
    You can't have Receiving parameter along with Changing and Exporting parameters in the same method.
    Regards,
    Naimesh Patel

  • Need call a method of one iview from another iview

    Hi,
    There are 2 iviews in a component.
    1) FirstView - contains abc() method & xyz() methods
    2) SecondView (a popup) - asdf() method
    i want to call abc() method from asdf() method. i.e. i want to call a method of the firstview from the secondview.
    Note:
    1) i couldn't able to copy the code of abc() method to component controller, as it has the code which uses (iview) local attributes (this can be done by context mapping) & main reason is from the method it calls the xyz() method of the same view (again i couldn't call a method of iview from component controller).
    2) firstView contain 5 tabs, i want to be in the same tab from which secondview (popup) was called, if i use fire plugs between both view, the current tab will be chnaged (i suppose, not sure).
    3) can we use event handlers, if yes how can we do that.
    Please provide a better solution for calling a method of view from another view.
    Thanks
    Maha
    Edited by: Maha Hussain on Jan 13, 2009 12:40 PM

    Hi Maha,
    It is better to have such methods in the component controller to make it reusable and avoid writing same code again and again.
    You can have that method in component controller and call that method on click on a button from Iview1 and can pass the parameters in the mthgod only.
    for example.
    Say Method abc() which is currently in Iview1 and you are passing values from context say aa bb cc to the method now what i am suggesting is
    have that method abc(String aa, String bb, String cc) ;
    and call it on click on button in Iview1 and pass the required parameters.
    Hope this will help
    Regards
    Narendra

  • How to call a method of one dc in another dc

    Hi,
          i have two dcs dc1 and dc2
    i want to call the method of dc1 interface controller in component controller of dc2
    plz help me, how to acheive it
    Thanks & regards,
    v santhosh

    Hi Vanama,
    Hope you have defined a method say method1() in interface controller of DC1
    Add this to public part.
    In DC2 , set DC1 as used DC.
    give <DCUsageName>
    now you can access the method in DC1 like this.
    wdThis.wdGet<DCUsageName>().getmethod1();
    Regards,
    Murtuza

  • How to call main method in one class from another class

    Suppose i have a code like this
    class Demo
    public static void main(String args[])
    System.out.println("We are in First class");
    class Demo1
    public static void main(String args[])
    System.out.println("We are in second class");
    In the above program how to call main method in demo calss from Demo1 class......???????

    No, i dont know how to call other than main methods from other classes
    And one more doubt i have i.e. Like in C can we see the execution of the program like how the code is being compiled step by step and how the value of the variable changes from step to step like(Add Watch).........

  • Calling a pkg from managed code and then using reflection to call a method from a script task

    Hi we run 2012 std.  I have some pretty good evidence that when I call my pkg from a .net service, a script component in that pkg fails when trying 2 use reflection to load and invoke our .net message history method.  The exception is either on
    the invoke or in the message history method.  I suspect its in the method but will take additional steps 2 verify.
    But when I run the pkg stand alone, it has no problem and the method does what it is supposed 2 do.
    There r no vars passed from the service to the pkg.  I wonder if its a managed to unmanaged to managed issue that the community is already aware of.  If not, my apologies 4 posting this quickly.
    I'll post more info here as I collect it. 

    we have 2 theories after showing the exception trace to folks who r more adept at managed code.
    the first is related to the fact that our 3rd party dlls (I think entity framework is included in these) r older versions.  I don't want to discount this theory but we have some evidence already that this might not be true.
    I hope I can do justice to the 2nd theory but will make it clearer and clearer as I get a better understanding.  I believe this is what Arthur was saying and I applaud his instincts.  They explained that .net is so "smart" that it detected
    a change in namespace  (ie context as Arthur said) and purposely threw an exception 2 save us from ourselves.  The workarounds discussed were a bit over my head but I will continue trying to better understand it.  The fact that many of the methods
    we call after reflection r now merged into one assembly seemed relevant to the discussion and possible workarounds.   
    this link came up in their discussion and I believe the bottom line here is that by qualifying assembly names further (in config?)r, a workaround is possible. 
    http://msdn.microsoft.com/en-us/library/system.type.assemblyqualifiedname(v=vs.110).aspx  .
    This link came up as well and has something to do with ILMerge and workarounds to ILMerge. 
    http://elegantcode.com/2011/04/02/dynamically-load-embedded-assemblies-because-ilmerge-appeared-to-be-out/  .
    Finally, this link came up and seems to have something to do with embedding your dlls in one assembly without them losing their identity.
    http://blogs.msdn.com/b/microsoft_press/archive/2010/02/03/jeffrey-richter-excerpt-2-from-clr-via-c-third-edition.aspx
    I'll post more here as we muddle thru this.

  • How to use Java to call a method in C program

    Hi,
    I have a method written in C program, and I need to call it in Java. Is there any way to do that? Thanks for ur suggestion.
    Regards

    Hi,
    JNI is the standard way to call C/C++ runtime code from Java.
    you find the spec under
    http://java.sun.com/products/jdk/1.2/docs/guide/jni/
    Greetings

  • Using reflector to call a method on an objectRef

    hey all! i have the following code to call a function to the objectRef that i keep in an array (jobServers) ...
    //   jobServers[0].objServerRef.addService(theCallbackObjectRef, number, jobServers);
               Class c = Class.forName("WorkflowFramework.Job");
               System.out.println(jobServers[0].functionName);
               Method meth = c.getMethod(jobServers[0].functionName);
               meth.invoke(jobServers[0].objServerRef, theCallbackObjectRef, number, jobServers);
    but i get the following error :
    addService
    FileClient Error: WorkflowFramework.Job.addService()
    java.lang.NoSuchMethodException: WorkflowFramework.Job.addService()
    at java.lang.Class.getMethod(Unknown Source)
    at Client.main(Client.java:123)
    in the first line i print the name of the function (addService) that i want to be called, and it is correct. Then i see that the function is called on the WorkflowFramework.Job and not on the jobServers[0].objServerRef which is an object of instanse Job.
    The addService function exists there because the declaration that is now in commends is running just fine if i take out the commends..
    Do you think the problem lies in the fact that Job is actually an interface declared like :
    //the job interface to enable client to choose services.
    public interface Job extends JobOperations, org.omg.CORBA.Object, org.omg.CORBA.portable.IDLEntity
    } // interface Job
    the addService function is declared in the JobOperations...
    any help plzzz?

    well.. you are kind of right...
    i write them as a struct in the IDL and the it is
    automatically transformed in the following java Class
    public final class lineArrayServers implements
    org.omg.CORBA.portable.IDLEntity
    public WorkflowFramework.Job objServerRef = null;
    public String functionName = null;
    public lineArrayServers ()
    } // ctor
    public lineArrayServers (WorkflowFramework.Job
    _objServerRef, String _functionName)
    objServerRef = _objServerRef;
    functionName = _functionName;
    } // ctorand then i wrap it in an array of these.. the
    jobServers...aha. so struct is an IDL construct in this case. I've never written any IDL, but I have written 'C', hence the confusion!
    thanks

  • Using reflector to call a method on the servant

    hey all! i have the following code to run a function to the objectRef that i keep in an array (jobServers) ...
    //   jobServers[0].objServerRef.addService(theCallbackObjectRef, number, jobServers);
               Class c = Class.forName("WorkflowFramework.Job");
               System.out.println(jobServers[0].functionName);
               Method meth = c.getMethod(jobServers[0].functionName);
               meth.invoke(jobServers[0].objServerRef, theCallbackObjectRef, number, jobServers);but i get the following error :
    addService
    FileClient Error: WorkflowFramework.Job.addService()
    java.lang.NoSuchMethodException: WorkflowFramework.Job.addService()
    at java.lang.Class.getMethod(Unknown Source)
    at Client.main(Client.java:123)
    in the first line i print the name of the function (addService) that i want to be called, and it is correct. Then i see that the function is called on the WorkflowFramework.Job and not on the jobServers[0].objServerRef which is an object of instanse Job.
    The addService function exists there because the declaration that is now in commends is running just fine if i take out the commends..
    Do you think the problem lies in the fact that Job is actually an interface declared like :
    //the job interface to enable client to choose services.
    public interface Job extends JobOperations, org.omg.CORBA.Object, org.omg.CORBA.portable.IDLEntity
    } // interface Job
    the addService function is declared in the JobOperations...
    any help plzzz?

    when i copy/paste that code in here i realised that..but i thought that it wanted the type of the class so it could make any sense to me to declare it as an array ...
    anw i changed the declaration to
    Class[] paramTypes = { WorkflowFramework.TheCallbackInterface.class, int.class , WorkflowFramework.JobPackage.lineArrayServers[].class};
         but i get a "wrong number of arguments " now...
    FileClient Error: wrong number of arguments
    java.lang.IllegalArgumentException: wrong number of arguments
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
    at java.lang.reflect.Method.invoke(Unknown Source)
    at Client.main(Client.java:167)
    how is this possible?!?!?!?

Maybe you are looking for

  • Problem with Web Analysis

    Hi, With the help from some of the experts in this forum, I have finished installing and configuring the following 3 Hyperion 9.3.1 products (in this order) on our Windows 2003 development server. V11229-01.zip (Hyperion Shared Services) V11207-01.zi

  • Disk Utility: Creating a new blank image receiving "file too large" error.

    Hello All! I'm trying to create a 10GB non-encrypted, non-compressed RW blank image via the disk utility. The DU runs for a few minutes then barfs out "file too large" error. I have over 30GB free on my HDD. I tried with a smaller size of 6GB to no a

  • Sending picture messages to, and from, my Nokia Lu...

    I am pay as you go with Vodafone but am unable to send or receive picture messages. Vodafone say that in the phone 'settings' there should be the options mms APN and edit APN but these are not on the menu. Any suggestions please?

  • Inputing Contact Information

    I am new to Blackberry and coming from Palm.  When Sprint transferred my contact over from my Treo (for some reason it wouldn't work for me), all of the information didn't transfer, and I am left going contact by contact to verify.  My question is th

  • Question about using USB Hub over 20 Ft

    I currently have a Mac Pro which has a USB 2.0 Hub attached to it (D-Link DUB-H7) and I need to add a 2nd hub. This 2nd hub would plug into this first hub and then would need to run approximately 20 ft. I would use a powered USB 2.0 like above but am