General design tip needed to write a small Jsp/servlet application

I am developing a small application using few JSP pages and a single servlet(as it iwas told to me that, number of servlet should be 1).
My problem is,
I have multiple JSPs. and multiple button within each JSPs.On click of each button, requeswt should be sent to Servlet and servlet performs some logic for esch button clicked.
I have 2 option to identify the button clicked and write the logic.
1.Servlet will get the value of each button.I will write one 'if loop' each for one button value. Whichever (request.getParameter("btnxyz")) returns 'NOT NULL', corresponding 'if loop' gets executed.This works fine.but servlet code looks like a mess as number of if loops = total number of buttons of all jsps.
2.Have a hidden field in each JSP.Onload of the button i will write some value to the field.On exit of JSp i will make it null.So, when button is clicked, in the servlet i will first identify the JSP from which request has come. and then identify the button as in step1.
My question is , which option is better?
Please suggest me other better solutions for the same.
Thanks,
Gowtam

Have you considered using Struts?
It would make your life so much easier.
Nick

Similar Messages

  • Need to restrict access to multiple servlet applications on same box

    Hi!
    I have deployed two separate servlet applications to the same IAS. I need
    to restrict access to each application - that is requests from one source
    should only have access to one application and not the other. The web
    server we are using is IIS.
    Should I create a separate IAS to deploy the second application to? Can I
    restrict based on IP - that is port 80 is reserved to application 1 while
    port 81 is restricted to application 2? If so, how do I go about this? It
    appears that the web connector only receives on one port (default 80).
    Any help would be greatly appreciated.
    Sheila

    I see. So do you mean that I can override the port number in the proxy startup script itself? I can try doing that and see if it works fine.
    About Coherence 3.7, yes. I did see that it has some cool features about proxy discovery. But at this point I am stuck at using 3.6 and 3.6.1.
    Edited by: online19 on Jun 29, 2011 5:41 PM

  • Design tip needed

    I need a tip how to create a long list:
    I want to create a list with, say, 100 entries. At first I tried with a List but it didn't display all items, I don't know why.
    1. Does anyone have any tip what I should use to display a list with 100 items to select from?
    2. It would be nice if it was like the contact list where the user can start to write letters and it jumps to the item starting with those letters. Any tip here?
    3. Is there a developer resource for midlet classes, like that Codeproject is for C++/C#? Just thinking if there was any such classes that I could look at. :)
    Thanks for tips!

    Have you considered using Struts?
    It would make your life so much easier.
    Nick

  • My daughter is a college student. she needs to write and compile c programs on her mac for a class this semester. what is the best place for her to start to get the correct compiler etc. to use ? thanks

    my daughter is a college student. she needs to write and compile c programs on her mac for a class this semester. what is the best place for her to start to get the correct compiler etc. to use ? thanks

    If you know that you will not be asked to design GUI interfaces, and the C programming course will adhere to command line compilation environments, then get the Xcode command-line developer tools, and skip the extra complication of Xcode until you absolutely need it. Apple has kicked GNU C to the curb and is rightly so, using Clang/LLVM compiler technology.
    Sign up for a free Apple Developer account using your Apple ID, and then visit the Mac Dev Center, and towards the bottom of the page, you will see additional downloads. Click on the associated, all down loads link. Know your OS X version beforehand, as the command-line tool releases are tied to general operating system versions, and the most recent Xcode version.  That said, there are currently two March 9, 2015 command-line tools for Xcode 6.2 — one for OS X 10.9 Mavericks, and the other for OS X Yosemite.

  • Need code for this Small validation on when-validate-item

    Hi All,
    I have a text item(date datatype) in forms 4.5 I need to do a small validation want to write on when-validate-item. When I enter a date in that text item (Ex 10-JUN-2005) it has to check
    1) It Cannot be "blank"
    2) It cannot be "Not older than today"
    can you please put me code for this small validation. I am new to Forms.
    Thanks in Advance,
    Reddy

    I always put code in the when-validate-RECORD trigger to ensure fields are entered, rather than setting the property. That way, the user can enter other fields within the record, and then gets a message that the field is required only when leaving the record.
    ...of course, if the date item is the only field in the block, then the when-validate triggers will not run unless the user at least types a space in the date. In that case, you need to check in the key-commit trigger.

  • Need help with a small application

    Hi all, I please need help with a small application that I need to do for a homework assignment.
    Here is what I need to do:
    "Write an application that creates a frame with one button.
    Every time the button is clicked, the button must be changed
    to a random color."
    I already coded a part of the application, but I don't know what to do further.
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    public class ColourButton extends JFrame {
         JButton button = new JButton("Change Colour");
         public ColourButton() {
              super ("Colour Button");
              setSize(250, 150);
              setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
              JPanel panel = new JPanel();
              panel.add(button);
              add(panel);
              setVisible(true);
         public static void main(String[] args) {
              ColourButton cb = new ColourButton();
    }The thing is I'm not sure what Event Listener I have to implement and use as well as how to get the button to change to a random color everytime the button is clicked.
    Can anyone please help me with this.
    Thanks.

    The listener:
    Read this: [http://java.sun.com/docs/books/tutorial/uiswing/components/button.html]
    The random color:
    [Google this|http://www.google.com/search?q=color+random+java]

  • Need to write a progrm to upload flate file  in my z table

    Hi all ,
            I    need to write a progrm to upload flate file from presentation or application server  in my z table.Please guide me to do so.
    Regards,
    Ranu

    You have sent this via Abuse Report:
    Please close my thread , so I can post new. I'll search before asking and wont ask small questions again.
    Considering that you have agreed to stick to the Rules, I'm closing this question so that you can open one new question. Based on how you carry on from here, I'll decide what to do next. If you behave, I'll close your other questions, but if you break the Rules even once, your id will be deleted.

  • Graphic Designer here, need to convince my company i need a mac (not a pc) !

    Hey guys,
    I'm looking for the ultimate guru's for a Mac vs. PC debate in a corporate office/firm setting. Basically, trying to convince CEO and IT why I need a mac. I'm a graphic designer for a land development firm. Work close with Landscape Architects and Civil Engineers.
    I'll take concept sketches and/or AutoCAD files (that are converted for me) and pretty them up in photoshop or illustrator, do planned development books in InDesign. Web services are offered, but it's not the primary vs. print.
    I'm currently working on a Dual-Core Xeon Dell workstation windows XP. Years ago up until 04' I was all about PC, but now have been accustomed to my mac.
    At home, I've got a Dual Dual-Core Xeon 2.66 that I love dearly, multitasks very well.
    I need to write up a report how this will communicate how I do my job better if i had a mac in the workplace instead of PC. I know that's a far-fetched statement, but trying to sell them on having me use a mac for my services while the entire office can cope with their PC network. I would appreciate any elaborate feedback and insight.

    Welcome to the Apple Community Frank.
    If you aren't using iCloud Keychain, it may be asking for your admin password. Where exactly are you looking.

  • Help needed in writting Customer exit - ABAP Code

    Hi Friends,
    I have a scenario in one of the query and need to write a customer exit for the same. Here is the scenario:
    I am using one input variable XXX to get input from user which feeds value to one of the charateristic  lets say "CHAR1" in query. I have one more characteristic "CHAR2" which has to get the value from the same variable XXX. This is not allowed in BI7.0 as the variable is Hierarchy Node type. It gives error that "Variable XXX is used for two different characteristics."
    So i need to create one more vaiable YYY which will get the value from XXX and then YYY will feed value to CHAR2.  I would appreciate if some one could tell me step by step how to write customer exit and give me the piece of ABAP code i need to write in my case.
    Your help will be appreciated in terms of points.
    Thanks,
    manmit

    Hi Arun,
    1. What should CHAR2 take - Hierarchy node variable or something else ?
    --> CHAR2 is a simple charateristic
    2. In your scenario - why have CHAR1 and CHAR2 ? why not have the user enter values against CHAR2 ??
    --> We dont want user to enter two input as the input values for both Chars are same.
    3. Did you try using a replacement path variable with the CHAR2 variable taking values from Variable on CHAR1 ?
    --> In BI7.0 replacement path variable only take values from Query results. So not able to do the same.
    Thanks

  • I am running Lightroom 6 in conjunction with 64 bit Photoshop CS6. I need to install Camera Raw 9 plus other relevan updates for the Adobe Design and Web Premium CS6 package. Running Adobe Application manager finds the relevant updates but won't download

    I am running Lightroom 6 in conjunction with 64 bit Photoshop CS6. I need to install Camera Raw 9 plus other relevan updates for the Adobe Design and Web Premium CS6 package. Running Adobe Application manager finds the relevant updates but won't download / install them. Clicking the update button results in an error message "Application Manager has stopped working". This is a windows system running 64 bit Windows 7

    update manually:
    pre cc updates:  http://www.adobe.com/downloads/updates/
    cc updates:  http://prodesigntools.com/adobe-cc-updates-direct-links-windows.html
    cc 2014 updates:  win (http://prodesigntools.com/adobe-cc-2014-updates-links-windows.html) / mac (http://prodesigntools.com/adobe-cc-2014-updates-links-mac.html)

  • Today is April 10, 2013. I try to login to iTunes connect and I keep getting the message "An error has occurred processing your request. Please try again later or send an email for assistance." It never tells us what email address we need to write to.

    Today is April 10, 2013. I try to login to iTunes connect and I keep getting the message "An error has occurred processing your request. Please try again later or send an email for assistance." It never tells us what email address we need to write to.

    The problem was solved by Apple Technical Help. The process is as flollows:
    1. Open Safari
    2. Menu item Safari-Reset Safari - remove all website data - reset
    3. Now if you try to login on iTunes connect it will work.

  • Need to write a report to show who is using SAP and to what extent

    Hi Experts,
    I need to write a report which should display who are using SAP and to what extent to forcast future SAP license needs...
    and to ensure the compliance by allocating license types correctly.
    My report should helpfull to organization to reduce the current license requirements and costs.
    Actually my problem is where can i get all these details in SAP, means from which tables.
    in which table can we get the sap user ids using mail id...
    Thanks in advance........
    Ram

    Hi gajeramesh ,
    Goto transaction 'SU10'
    Here you have all the data selection regarding a particular user id, so what you can do is do F1 on any of the fields and see the technical help in that for the table names.
    some of the tables are :
                                     1) 'USUSERS'(User: Transfer structure for lists of users),
                                     2) 'USER_ADDR' (Users by address data)
                                     3) 'USUSERALL' (Users with All Data for List Output)
    I hope this helps you  !!

  • Need to write ABAP Routine at infopackage Selection Options

    Hi All,
    I need to write ABAP Routine at Info Package Selection Options.
    Requiremnet i need to bring  some Sales Document Types (Sales Orders Types) only from R/3.
    Ex I need OrderTypes ZQT,ZSIV etc
    Can any body help to resolve this.
    Regards,
    P.C.V.

    Hi P.C.V,
    If the order type field is already available in the Data Selection Tab of the InfoPackage, then you just need to place your selections there (e.g. order type = ZQT, ZSIV) without the need to use ABAP routines.
    If ever you really need an ABAP routine, here is an example ABAP routine. The most important concept is to modify the range table l_t_range so that the selection reflect what you need.
    data: l_idx like sy-tabix.
    data: w_startdate like sy-datum,
          w_startweek like scal-week,
          w_maxdate like sy-datum,
          w_maxweek like scal-week.
      w_startdate = sy-datum.
      w_maxdate = w_startdate + 104 * 7.
    * Calculate horizon for extraction
      CALL FUNCTION 'DATE_GET_WEEK'
        EXPORTING
          DATE         = w_startdate
        IMPORTING
          WEEK         = w_startweek
        EXCEPTIONS
          DATE_INVALID = 1
          OTHERS       = 2.
      CALL FUNCTION 'DATE_GET_WEEK'
        EXPORTING
          DATE         = w_maxdate
        IMPORTING
          WEEK         = w_maxweek
        EXCEPTIONS
          DATE_INVALID = 1
          OTHERS       = 2.
              read table l_t_range with key
                   fieldname = 'CALWEEK'.
              l_idx = sy-tabix.
              l_t_range-sign = 'I'.
              l_t_range-option = 'BT'.
              l_t_range-low = w_startweek.
              l_t_range-high = w_maxweek.
              modify l_t_range index l_idx.

  • I Need to Write the current Date and Time

    I need to write the current date and time to calculate the spend time in each instruction.
    What is the instrucion?
    Thanks.
    MIGUEL ANGEL CARO
    [email protected]

    The current time can be determined with a Date object:
    Date now = new java.util.Date() ;or if you are interested in the seconds since the epoch:
    System.currentTimeMillis() ;If you wanted to print them out:
    System.out.println( new java.util.Date() ) ;
    System.out.println( System.currentTimeMillis() ) ;Kenny

  • In InDesign, how does one determine the pixel size of a text box? Specifically, we need to write text to specifications of 600 pixel width, and have no idea a) how to scale a text box to specific pixel width, b) how to

    This may be a basic question... but in InDesign, how does one determine the pixel size of a text box? Specifically, we need to write text to specifications of 600 pixel width, and have no idea a) how to scale a text box to specific pixel width, b) how to determine what word count we can fit in, and c) how to do it in a table? Thanks!

    Set your ruler increments to pixels Preferences>Units & Increments. You can fill the text box with placeholder text Type>Fill with Placeholder text and get a word count from the Info panel with Show Options turned on from the flyout.
    From the Transform panel you can set a text box's width and height

Maybe you are looking for

  • Web-Sharing does not start up-

    Hello, I have a problem with my Web-Sharing. When I activate "Web-Sharing" in my Sharing-Preferences, the httpd (Apache webserver) doesn't start up (as can be seen in the activity monitor), thus I'm not able to connect to the webserver with Safari. I

  • Re  acrobat write v8

    I have a color pdf file that I am trying to change to b/w for printing. I have figured out how to change the text color. But I am stumped on how to change the background page color. Can someone help me with this problem. Steve

  • SAVE AS reduces file size, but do I lose quality?

    I've got a large textbook with 4-color graphics and the file sizes can get out of control. When I replaced a single page and then doing a SAVE AS and overwriting the original, the file size dramatically reduced. Then I did a test, and found it works

  • Bpel timeout issue...payload size is 6MB...

    Hi All, what is the max payload size could be processed through oracle soa BPEL composite, I have a requirement that data(records of 2k-4k) of total size 6MB comes from DB, and each record has to be to sent to an external webservice,but it timesout,

  • Auto-run file on USB flash drive

    Is it possible to Auto-run a file on USB flash drive when it is first plugged in, or when it is clicked on ?