Determining the source button of servlet

im having problem determining the source button when the user click one of two button
the source code as follows
import javax.servlet.*;
import javax.servlet.http.*;
import java.io.*;
public class write extends HttpServlet {
boolean isBeingSent;
protected void doGet(HttpServletRequest req, HttpServletResponse resp)
throws ServletException, java.io.IOException {
PrintWriter out = resp.getWriter();
out.println("<html>");
out.println("<head>");
out.println("<title>");
out.println("write");
out.println("</title>");
out.println("</head>");
out.println("<body background = C:/tomcat/webapps/" +
"mailconnect/images/write.bmp>");
out.println("<font face = 'arial'>");
out.println("<font face = 'arial'>");
out.println("<br>");
out.println("<br>");
out.println("<form method=\"POST\">");
out.println("&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp"+
"&nbsp&nbsp<input type = 'text' name = \"receiver\""+
" size = 40> ");
out.println("&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp"+
"&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp"+
"&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp"+
"&nbsp&nbsp&nbsp&nbsp<input type = 'text' name =\"subject\""
+ "size = 40>");
out.println("<br>");
out.println("<br>");
out.println("</font>");
out.println("<br>");
out.println("<textarea name =\"message\" rows=20 cols=60> ");
out.println("</textarea>");
out.println("<br>");
out.println("<br><input type = submit name = 'send' value ='send'");
out.println("</form>");
/*Supposedly this is the second button that can be clicked but i did not included it in the form tag*/
out.println("<input type = submit name = 'saveasdraft' value ='save" +
" as drafts'>");
out.println("</font>");
out.println("</body>");
out.println("</html>");
protected void doPost(HttpServletRequest req, HttpServletResponse resp)
throws ServletException, java.io.IOException {
/*i wish i could send this to beensaved servlet when the user clicks save as draft button*/
RequestDispatcher rd = req.getRequestDispatcher("beensent");
rd.forward(req,resp);
if we cannot determine the source button is there a way that i can set the beingSent boolean variable if the user clicks the send button? how can i do so? thank you so much
the send button

When the page is submitted, it sends the name/value pair of the button that was clicked with it.
I second the comment about this being better as a JSP. Using out.println in a servlet like this was the whole reason JSPs were invented in the first place.
Anyway, given you have the following HTML
<input type = submit name = 'send' value ='send'>;
<input type = submit name = 'saveasdraft' value ='save as drafts'>
// the following check in java code can be made
boolean sendButton = request.getParameter("send") != null;
boolean saveasdraftButton = request.getParameter("saveasdraft") != null;Cheers,
evnafets

Similar Messages

  • How to determine the source of Events triggered in a process chain

    Hi ,
      We have almost a 100 process chains, and of these approx 20-30 local process chains are triggered by events raised within other process chains.  These events are raised via BP_EVENT_RAISE using the ABAP process type.
    However, our problem is to identify the source of these event trigger - i.e. which process chain triggered this event ?
    Looking at SM64, the event history does not display the source for these events.
    Is there any table or program that we can use to determine the source of these events which are triggered.
    Any help is much appreciated and points awarded.
    thanks
    BK

    Hi,
    do check in the program /SSA/BWT . or TCODE - ST13 -- enter BW-TOOLS and execute. -- Choose Process chains and execute --- Select the date and time for which you want to see the process chains and execute again.
    This will give you the entire list of process chains triggered, status, timings(start, end, overall runtime). Once clicked on the process chains it will show you the steps in theprocess chains, data loaded in the data targets, source system, etc...
    hope it helps.

  • How to determine the source to where my saved photo (not taken by my iPhone camera) on whether what application or website did i got that photo? need to go to the source again, please help

    how to determine the source to where my saved photo (not taken by my iPhone camera) on whether what application or website did i got that photo? need to go to the source again, please help

    There is no way to trace the source of a saved photo.
    You might have some luck if you search through the Safari web site history available via the Bookmark icon.

  • How to determine the source of a Data Source

    How do you determine what the source is for a given Data Source? We are working with 0BP_RELATIONS_ATTR, which is a data source in the BI source system. However, we cannot figure out how to determine what the source is for this data source.

    Hi David,
    Have you seen this excellent blog by Roberto Negro : /people/sap.user72/blog/2005/09/05/sap-bw-and-business-content-datasources-in-pursuit-of-the-origins
    Hope this helps...

  • Determine the source -- BufferedReader

    I have start Java programming and one of the function that I need to make is a read(), which accept PrintStream and BufferedReader. In this function, it supposes to determine whether the BufferedReader is from a keyboard (system.in) or a file. Now, I wonder how do you know if BufferedReader is accepting a keyboard or a file?
    public static void main (String [] args) throws Exception
    BufferedReader kb = new BufferedReader(new InputStreamReader(System.in));
    System.out.print("\nPlease enter a file name with extension: ");
    String inFileName = kb.readLine();
    BufferedReader br = new BufferedReader(
    new InputStreamReader(
    new FileInputStream(
         new File(inFileName))));
    //Obviously I could send either one... kb or br;
    Fraction.read(System.out, kb); //accept user input and print on monitor
    Fraction.read(System.out, br); //accept file input and print on monitor
    public static Fraction read(PrintStream ps, BufferedReader br) throws Exception
    //What do I need to test whether br == file or keyboard?

    Your code doesn't make much sense, though... why would you ever want to pass 'kb' to Fraction.read()? So that you can get use input rather than reading it from a file? That's all well and good, but your problem isn't determining the BufferedReader source, it's in distinguishing whether the user wants to use the keyboard or a file. Another odd thing about your code is that, there really isn't any reason to know the source of the BufferedReader data at all... whether you pass kb or br, the way you read stuff will be the same.
    Try something more like:
    1) Ask user for a file name.
    2) If user doesn't enter a file name, then tell them to type whatever data they wan't processed and pass kb to Fraction.read().
    3) If user does enter a file name, the pass br to Fraction.read().

  • Determine the source server in RFC calls

    Hi All,
    is there any posibillity to find out what is the source server of an RFC function call inside the FM and if it's an qRFC what is the queue name.
    Thanks Thomas

    For the non-qRFC scenario you may want to try:
      CALL FUNCTION 'RFC_SYSTEM_INFO' DESTINATION 'BACK'
        IMPORTING
          rfcsi_export          = rfcsi_export
          rfc_login_complete    = rfc_login_complete
          dialog_user_type      = dialog_user_type
          current_resources     = current_resources
          maximal_resources     = maximal_resources
          recommended_delay     = recommended_delay
        EXCEPTIONS
          communication_failure = 1  MESSAGE dest_communication_message
          system_failure        = 2  MESSAGE dest_system_message.
    The RFCSI_EXPORT parameter will give you a few details of the calling system (host, sysid, etc...).

  • How to determine the source of text

    hi ,
    i have created  the standard text in so10.
    During creation of a sales order it is appearing  fine .
    But the problem is,
                           how can we know that from where the text is coming as i forgot the text name.
                           I also tried to enter the text in the text field in so10 but no vain.
                           Please help me in this issue.

    Hi Srikanth,
    You can find all the texts that were created in table STXH.
    There give the inputs like created by or the date range that these text were created and execute the table. You will find all the text created by the given user or between a date range.
    Hope that solves your problem.
    Regards,
    Swami

  • HT201493 What determines the notify button activation?

    I know the location of two friends but I can be notified when one of them moves but not the other one!

    The other user needs to be running iOS 6 or later for you to be notified when they move.

  • Pioneer 8400 DVD receiver player, as iPhone ios6 update now when connecting the new iPhone with ios6 via blutooth (firmware prob) to my car DVD 8400 unit, when playing music such as on my phone or Pandora the track button does not function or work at all

    pioneer 8400 DVD receiver player, as iPhone ios6 update now when connecting the new iPhone with ios6 to my car DVD 8400 unit, when playing music such as on my phone or Pandora the track button does not function or work at all not even if i press skip track forward or back on the unit it doesn't function everything works except that. on listening to radio or anything else related not pairing thru Bluetooth unit works fine, seems there to be Bluetooth update that is not making iPhone and unit not compatible at all. does pioneer need fix this problem with update firmware or thru apple need help. my iPhone was working fine before with previous ios 5 before.

    Dear Valued Pioneer Customer:
    We would like to inform you of the availability of an optional Bluetooth® firmware update (HW05-SW01.27.20) that enables Bluetooth AVRCP control and metadata display from a compatible Pioneer CD or DVD Receiver when used with an iPhone® 5 or iOS 6 device.  If you do not own an iPhone 5 or iOS 6 device, there is no need to install this update.
    This firmware update may be used only with the following 2012 Pioneer products:
    CD Receivers
    DVD Receivers
    DEH-P8400BH
    DEH-P9400BH
    DEH-80PRS
    AVH-P2400BT
    AVH-P3400BH
    AVH-P4400BH
    AVH-P8400BH
    In order to perform this update, the following items are needed:
    A Pioneer CD or DVD Receiver above with built-in Bluetooth
    Laptop with built-in Bluetooth running Windows® 7
    Bluetooth firmware update (HW05-SW01.27.20)
    How to Obtain the Free Firmware Update
    1. Download the INSTRUCTIONS for the optional Bluetooth firmware update (HW05_SW01.27.20).
    2. Download the UPDATE FILE to a computer and transfer the file to a compatible 2012 Pioneer CD or DVD Receiver via a Bluetooth-enabled Windows 7 laptop.
    You can also arrange for Pioneer to update your 2012 Pioneer CD or DVD Receiver by calling Pioneer Customer Service toll free at 800-421-1404 during regular business hours (M-F 10AM-7:30PM Eastern Time, except on holidays). If this firmware update is performed by Pioneer, there is a charge of $60.00 (this charge includes return shipping of the updated unit within the U.S.). Charges for removal/reinstallation of the unit and shipment to Pioneer are the customer’s responsibility.
    How to Determine if the Firware Update has Already been Installed
    CD Receivers:
    • With the unit turned off (press and hold the source button until the CD Receiver turns off), press and hold the center of the volume knob to bring up the Settings menu → rotate the volume knob until "BT Version Info" is displayed and then press the center of the volume knob → The firmware version should show HW05-SW01.27.20.
    DVD Receivers:
    • With the unit turned off (press the home button and select ‘OFF’ from the source icons), press the home button → Press the “System” icon at the bottom of the screen → Select the “Bluetooth Version Info” option → The firmware version should show HW05-SW01.27.20.
    If the Bluetooth firmware version shows HW05-SW01.27.20, no further action is necessary.
    Questions
    If you have any questions, please contact the Pioneer Customer Service Center toll free at 1-800-421-1404, Monday through Friday, 10:00 a.m. to 7:30 p.m. (Eastern Time), except on holidays.
    Sincerely,
    Pioneer Electronics (USA) Inc.

  • Using Firefox 3.6, how do I determine the souce of a view of my business website?

    I have a website, hosted by Earthlink. I employ Firefox 3.6 for viewing my website. Is their a way to use Firefox to determine the source of views of my website?
    Thank you.
    johnfogelman

    Right-click the page and select '''View Page Source'''.

  • How do I map the source file name to a target table?

    I am mapping a source fixed length flat file to oracle target tables. One of the tables is a parent transaction table that stores the date, record number, status, etc. and the file name of the source flat file. The file name will change daily because the date is part of the naming convention. Is there an easy way to determine the source file name and map it?
    One option a co-worker is working on is writing a pre-mapping stored procedure. It would insert the file name into a table prior to the mapping. But I was hoping for a cleaner solution.
    Thanks!

    Hi
    Use extarnel table to load the data from the file into the table.
    Create a procedure which changes the external table definition as the filename chnages.
    Use this proceudre in the mapping as a premapping process.
    Ott Karesz
    http://www.trendo-kft.hu

  • SharePoint PPS 2013 Dashboard Designer error "Please check the data source for any unsaved changes and click on Test Data Source button"

    Hi,
    I am getting below error in SharePoint PPS 2013 Dashboard Designer. While create the Analysis Service by using "PROVIDER="MSOLAP";DATA SOURCE="http://testpivot2013:9090/Source%20Documents/TestSSource.xlsx"
    "An error occurred connecting to this data source. Please check the data source for any unsaved changes and click on Test Data Source button to confirm connection to the data source. "
    I have checked all the Sites and done all the steps also. But still getting the error.Its frustrating like anything. Everything is configured correctly but still getting this error.
    Thanks in advance.
    Poomani Sankaran

    Hi Poomani,
    Thanks for posting your issue,
    you must have to Install SQL Server 2012 ADOMD.Net  on your machine and find the browse the below mentioned URL to create SharePoint Dashboard with Analysis service step by step.
    http://www.c-sharpcorner.com/UploadFile/a9d961/create-an-analysis-service-data-source-connection-using-shar/
    I hope this is helpful to you, mark it as Helpful.
    If this works, Please mark it as Answered.
    Regards,
    Dharmendra Singh (MCPD-EA | MCTS)
    Blog : http://sharepoint-community.net/profile/DharmendraSingh

  • I am trying to listen BBC radio news from BBC App, but on pressing the button I always get the error "there was an error playing this radio feed". What is the source of this error and how can I remove it?

    I am trying to listen BBC radio news from BBC App, but on pressing the button "live radio" I always get the error "there was an error playing this radio feed". What is the source of this error and how can I remove it?

    That is probably just a generic error message and you might not ever know what is causing it. Assuming that you have been able to play live radio with the app in the past (I know nothing about the app) and assuming that all other Internet related functions (Safari, email, etc.) are working properly on your iPad, quit the app completely and reboot your iPad.
    Go to the home screen first by tapping the home button. Double tap the home button and the recents tray will appear with all of your recent apps displayed at the bottom. Tap and hold down on any app icon until it begins to wiggle. Tap the minus sign in the upper left corner of the app that you want to close. Tap the home button or anywhere above the task bar.
    Reboot the iPad by holding down on the sleep and home buttons at the same time for about 10-15 seconds until the Apple Logo appears - ignore the red slider if it appears on the screen - let go of the buttons. Let the iPad start up.
    If that fails to resolve the issue, you might want to reboot your router, unplug it for about 30 seconds and then plug it in again.

  • How to find out the source of an event fired by button in a table in WD?

    Hi experts,
    I'm new to Web Dynpro and I need to know how to find out the source of an event (IWDCustomEvent) fired by a button in a table? I need to know which one is the clicked button (on which row)?
    Help will be appreciated
    Regards

    Hi GLM,
    thanks for your reply. Yes I know about that but when a round trip to the server is made the lead selection is at the first row of the table and when i click the button on, for example, the 3rd row the getLeadSelection method returns 1 and the color marker for the current row stays on the first row. So I need to click first somewhere else on the 3rd row and then on the button in order to update the value of lead selection and it's not very nice. So if you have some other idea it would be very helpful. Or perhaps some workaround.
    Regards

  • How to  determine the Person who Rejected the SC item in Sourcing

    Hi Experts,
    We are working in SRM 7.0 ERP 6.0 EHP 4 in a classic Scenario.
    We are creating free text SC without Supplier and on approval the Shopping carts are getting into Sourcing Queue.
    In Carry out Sourcing the Purchaser is selecting the SC item and rejecting some items.
    How can we determine the person who is rejecting the item in the Sourcing cockpit
    Thanks
    Pooja

    Hi
    Please see the below thread and answer your question
    Issue in determining the Person who Rejected the SC item in Sourcing
    Thanks
    Ashish

Maybe you are looking for

  • Select All in ADF RichTable gets exception

    One of my ADF tables gets the traceback below when I do a select all (either via ctrl/a or clicking on the row header). Can anyone suggest what I might do to prevent it -- it appears to not involve any custim code [2012-05-23T14:51:40.984-07:00] [oim

  • Hierarchy loading Error in Production system

    Hi All, I am loading Hierarchy file, the file is there in application server(AL11), in external tab i gave same path. but when i try to load it is showing below Error message. Invalid entry, hierarchy 0XMK4PVWO05BM4GP5KVEFQ9L4 does not exist. Diagnos

  • Extending the Tab Navigator

    Hi, I am trying to do some work in Xcelsius that is dependent on knowing which tab is selected in a tab set.  It does not appear that getting this information is possible with the Tab Set component provided by Xcelsius.  I have started to dig into th

  • I've installed J2SE 1.4.2 SDK + NetBeans 3.6. Now what do I do??

    Hello, When I go into NetBeans, I get confused on what to do when they ask to mount a filesystem. And also how do I set up the Java classpath? Like I said, I've just installed it and was wondering if you could give me instructions on how to set thing

  • Disable/Hide Data connection error pop ups in InfoPath 2010

    Hi All ,  I am trying to hide/Disable Error Messages Shown by data connection error. I do not want user to see the error , rather I would check through rules and query the Data source again. Is this scenario possible at all.  For ex: I have a data co