How to dynamically generate HTML in Servlet without all the out.println?

Since I am not sure whether this is a Java Servlet or JSP problem, so I will describe my situation. And hopefully someone can propose a good solution. I came from a PHP, so Java Servlet and JSP are still a little bit foreign for me.
My problem
My front end is a JSP page that essentially contains a form (let’s call it form1). The reason it is a JSP not a HTML is because I will need to load form data from the backend and display them in the form. Once the user submits the form, it will go to a backend Java Servlet (let’s call it servlet 1), which loads data from files according to user input. Then, I will need to dynamically create a new form (let’s call it form2) based on the data loaded from files. Once the user inputs and submits form2, another Java Servlet (servlet 2) will do more processing. That is the end of line. Both form1 and form2 require Javascript.
My question is that since servlet 1 will need to dynamically create form2. I naturally will want a presentation control. Instead of doing out.println(“html code”), I want to use JSP and write direct HTML code. On the other hand, can JSP be used as a form action? So basically, in form 1, can I do <form action=”…/xxx.jsp”> I think I saw something like this, but I lack the comprehensive JSP knowledge to know for sure. More importantly, if hypothetically JSP can be used, how do I handle functions such as doGet(HttpServletRequest request, HttpServletResponse response), which is used in servlet1.
Thank you,
M

no, servlets should not be used to generate a view, that is what a JSP is for. So let your backend servlet fetch the data, put it for example as attributes of the request scope (request.setAttribute()) and then forward control to a JSP that will generate the view, based on the information you stored in the request scope. That is the proper way of using servlets & JSPs; use servlets to invoke business logic classes, use JSPs combined with JSTL to generate the view. If you do it properly, you don't need ANY java code in your JSP.

Similar Messages

  • I would simply like to write music on a blank manuscript.  How do I do this on GB without all the complicated synthethising stuff that's in GB?

    I would simply like to wriet music on a blank manuscript.  How do I do this on GB without bothering with all the sythethising stuff that's in GB?

    GarageBand is not really notation software. It can show you the score, but you have no control at all over the layout. Any real notation software like Finale would be preferable, for what you want to do.
    You can show the musical score in GarageBand for any software instrument track in the Track Editor. What is your GarageBand version?
    Basicallly, in all versions, you enter the music by playing and recording your midi keyboard, or by manually entering the notes by command -clicking onto the staffs in the track editor to add notes. You can add them directly in Score-view or in the piano-roll view. In Piano-Roll view it is easier to adjust the timing of the notes.

  • I have an old 4GB Ipod nano and an I-Phone 4S. I only want music to sync to my I-Pod without all the apps from the phone. Can someone tell me how to do this please?

    I'm updating the music in my I-Tunes. I have an old 4GB Nano but I also have an I-Phone 4S. I only want music and nothin else on my I-Pod, how can I get it to sync without all the apps as, obviously the I-pod doesn't have enough memory?

    "Other" is data that the iPod doesn't know how to deal with (but on your nano, it isn't Apps). All iPods have some quantity of "Other" on them. Sometimes Other is corrupt files that cannot be read.
    The usual remedy when the quantity of Other becomes too big, is to Restore the iPod. However, 0.26GB of Other doesn't appear to be very much and I suspect you won't see much change, if any, if you Restore.

  • Displaying dynamically generated HTML

    Hi!
    Is it possible to display dynamically generated HTML-page by means of ITS?
    I want to write report in ABAP and generate HTML-page with report data, then display it on client side.
    Is it possible?
    Thanks!

    Hello,
    As long as it has a transaction code then probably yes.  Just use the webgui service.
    Edgar

  • How can I move columns in Numbers without distorting the formula in other cells?  In Excel I can cut and paste entire columns and the formula in other cells adjusts accordingly.  When I do it in Numbers, the formula messes up.  How can I do this?

    How can I move columns in Numbers without distorting the formula in other cells?  In Excel I can cut and paste entire columns and the formula in other cells adjusts accordingly.  When I do it in Numbers, the formula messes up.  How can I do this?
    For example: I have formulas in columns D and F that relate to columns C to CU
    If I want to move one column from one position to another (say S to T), the formula loses the colums that was moved, i.e. it doesn't recognize it has moved, rather sees it as deleted...  How can I do this without distorting the formula?

    Thanks for the feedback.
    If I often urge askers to look at the available resources, it's because  a large range of questions asked in the forums are already answered in these documents.
    As they are PDFs, they are easy to search in.
    CAUTION
    Download them while they are available.
    Given what is delivered with iBooks Author, I'm afraid that we will not get such easy to use documents.
    Searching infos in the  iBooks Author documentation available on line is awfully cumbersome and a lot of embedded links are wrongly flagged this way. In the Help files they aren't links but underlined strings.
    It seems that the tool used to generate the web pages was wrongly configured.
    Yvan KOENIG (VALLAURIS, France) dimanche 22 janvier 2012
    iMac 21”5, i7, 2.8 GHz, 12 Gbytes, 1 Tbytes, mac OS X 10.6.8 and 10.7.2
    My Box account  is : http://www.box.com/s/00qnssoyeq2xvc22ra4k
    My iDisk is : http://public.me.com/koenigyvan

  • How to install windows server 2012 r2 without remove the current windows 8.1

    how to install windows server 2012 r2 without remove the current windows 8.1

    Use guide below to convert it to 'basic' disk, or install windows on another drive. The supported way is to delete all partitions and convert it to a basic disk.
    https://technet.microsoft.com/en-us/library/cc755238.aspx
    However, your windows 8.1 must be on another drive?, as windows cannot boot from a dynamic disk.
    Best Regards,
    Jesper Vindum, Denmark
    Systems Administrator
    Help the forum: Monitor(alert) your threads and vote helpful replies or mark them as answer, if it helps solving your problem.

  • How to recover my viber messages? without replacing the other application when i will restore my last backup.

    how to recover my viber messages? without replacing the other application when i will restore my last backup.

    Maybe from the restored iPod via How to perform iPad recovery for photos, videos
    Wondershare Dr.Fone for iOS: iPhone Data Recovery - Wondershare Official     
    http://www.amacsoft.com/ipod-data-recovery.html
    iPod recovery software to restore lost music files      
    http://www.pcrecoverytools.com/ipod-data-recovery.html
    Yu also said:
    I think this is because
    I backed up a long time ago, and the iTunes update may have erased the back up?
    No, updating iTunes does not delete any iOS device backups.

  • Reg: How to Stop Polling of JDBC Adapter without Scheduling the adapter

    Dear Gurus,
    Here I am having one requirement. My clients wants to send data from JDBC adapter (ORcale System table) to R3 system via RFC.
    His Requirement::
    1. He is not telling the time of data flow from Oracle server so that based on that we can schedule the adapter in the Communication Channel monitoring (Availablitiy Time Planning) or Else we can Schedule by deciding the setting of the polling interval time.
    2. He is telling that When ever he waants to send the data he will place one dummy file in the File Adapter FTP location so that it will became an Indication for u to poll the jdbc adapter and to transfer the data to R3.
    3. Untill he keeps the file or gives indication he doesn;t want to communicate with Oracle server due to some security and it s a most important data base he doesn't want to disturb that Oracle Server as so many business are running  on that.....
    We Proposed::
    1. Atleast you need to tell the scheduling time or poll interval time so that we can schedule our adapter.
    but he s not accepting for this
    2. Atleast U need to give access for Data base to enter one more extra field like STATUS CODE so that we will add one number and we keep on Update in the Update table and based on that Update table statement it will poll.
    but he s not even accepting for this
    3. Finally we prposed that to create another table in the Oracle SYstem as Dulplicate Table which is similar to Standard Orginal table when ever he wants to pick the data please keep that data in this Duplicate TABle so that JDBC adapter will pick the data from thsi TABLE instead of picking the data from that standard table so that it will not effect any standard table data in the table.
    but he s not even accepting for this
    We have done some R & D:::
    1. WE approached even through BPM and via switch conditions is one scenario
       FILE RECEIVE >SWITCH CONDITION> RECEIVE AND SEND or else EXIT
    2. Using correlation in anotehr scenario means correlating File adapter and JDBC and based on one dynamica value it will goes to SEND STEP ( RECE IVE --> RECEIVE --> SEND STEPS )
    Even though we know this...concept that...we jsut tried::
    In BPM we can control the flow in XI 3.0 but we cannot Stop the Polling of JDBC adapter at backend because one the data comes from FILE adapter it will keep on HOLD untill it receives the JDBC from Oracle then based on the condition or Correlation it will goes futher SEND step means after that file adapter is picking file or not ...what ever it may be JDBC will polls at backend and brings that data to BPM"
    Hence sugest me How to Stop Polling of JDBC Adapter without Scheduling the adapter or else using STATUS CODE Update statements in JDBC Tables 
    Regards:
    Amar Srinivas Eli

    Hi! All,
    Finally I decided to do the scenario in two steps:
    1: FILE REQ --> JDBC REQ -->JDBC RES --> FILE RECV
    2: FILE RECV --> RFC
    But I am getting issue while doing first scenario
    Desgn :
    I have created 2 Synchronous interfaces :
    1) FILE 2 JDBC REQ
    In this a) out put message is FILE  Req
              b) Input msage:; FILE RES
    2} JDBC2FILE RECV
            a) Output mesage;; JDBC REQ
            b) Input Msge :: JDBC Response
    Mappings:
    1) File REQ-->JDBC REQ
    2) JDBC RES-->FILE RES
    Interface mappings:
    1: FILE 2 JDBC REQ--> JDBC 2 FLE RECV
    CONFIGURATION ::
    1: One Seder File CC
    2: Two reciever CC's one is for JDBC RECEIVER and other s FILE RECEIVER
    3; One Sender Agreement
    4: 2 Recver agreements
    5: One Interface Determination and
    6: One RECCV Determination
    My Question;;
    1. First let confirm whether my development steps are right or not ?
    2: Another thing s I am not sure reg Configuration Steps means
    whetehr one interface determination and one Receiver Determinations are required or not as these are synchronous Interfaces
    3: main Issue is::::
    If my scenario s FILE2RFC2FILE then I will get RFC response automatically but here issue is this is JDBC
    My reqquirement is By sending one Field from fILE to JDBC REQ it needs to send entire TAbLE records as a Response to file as XML
    without having Sender JDBC how can I send the JDBC Res to FILE and If that is the case then again JDBC adapter is polling which is contradict to the client requuirement which i explained above.
    pleas suggest me the Detailed steps mainly Colloboration agreements and logical routings and
    also explain in detail if i can  go for BPM
    Also give cleear blogs but before giving make sure that it contains detailed screen shots because aIready gone thorugh
    Scenario File-JDBC-RFC
    File<-->JDBC Sync coomunication.
    https://www.sdn.sap.com/irj/scn/wiki?path=/display/xi/file-rfc-file(Without+BPM)
    /people/luis.melgar/blog/2008/05/13/synchronous-soap-to-jdbc--end-to-end-walkthrough
    Regards::
    Amar Srinivas Eli

  • My friend synced a video to my ipod but it erased all my data on my ipod,but i cant figure out how to load my old libray back without deleting the movie. my friend cant tell me the password. How can I get my old library back without deleting the movie?

    My friend synced a video to my ipod but it earased all my data on my ipod,but I can't figure out how to load my old library back without deleting the movie. My friend shares a family account so she can't tell me the password. How can i get my old library back without deleting the movie?

    Linnwarner wrote:
    She does have the right because she bought the movie.
    Not true at all.
    You only buy the right to your own personal use.
    You do NOT have the right to distribute to others.
    This is illegal.  There is no doubt about it

  • I forgot my password for my apple ID. Any ideas on how to put in a new one without knowing the old one?

    I forgot my password for my Apple ID. Anyone have a solution on how to put in a new one without knowing the old one?
    Thanks

    Welcome to Apple Support Communities
    You have to reset your password. You can do this in this site > http://iforgot.apple.com

  • How Can I restore my ipod shuffle to factory setting (without all the software updates)?

    After updating my ipod shuffle, my car no longer recognize it. I cannot connect it to my car via usb. For the past few weeks I have been listen to only songs on the radio. I tried to restore it, but fond out that all it did was removed all my songs ect, but the update is still the most current version. Please someone, please help me. How can I restore my ipod shuffle to the original factory setting without all the update.

    You may have the accessibility VoiceOver feature or another one turned on.
    Triple click the home button and try going to Settings>General>Accessibility and turn VoiceOver off and any others off. You may have to use three fingers to scroll the screen to get there. If problems see the following for how to turn off via iTunes:
    iPhone: Configuring accessibility features (including VoiceOver and Zoom)
    Next try:
    Try:
    - Reset the iOS device. Nothing will be lost
    Reset iOS device: Hold down the On/Off button and the Home button at the same time for at
    least ten seconds, until the Apple logo appears.
    - Restore from backup. See:                                 
    iOS: How to back up                                                 
    - Restore to factory settings/new iOS device.
    If still problem, make an appointment at the Genius Bar of an Apple store since it appears you have a hardware problem.
    Apple Retail Store - Genius Bar                       

  • How can I reset my administrator password, without knowing the original administrator password?

    Hi guys,
    I use a MacBook Pro with OS X 10.8 Mountain Lion. A few months ago I reset my administrator password and have not been able to remember it since. Consequently, I haven’t been able to do any software updates, my computer is running slow and I'm getting a lot of pop-up junk on my screen. I’m the only user on my computer, apart from the Guest User (Sharing only).
    How can I reset my administrator password, without knowing the original password?
    Thanks.

    Resetting Password and/or Home Folder Permissions

  • How do I close a numbers document without closing the entire app?

    Can anyone tell me how I can close a numbers document without closing the entire app? i.e. go back to the folders display page - is this even possible?

    It is not a bug, but a new feature.<br />
    Some menu entries in the main menu bar are hidden if you use the mouse and only appear if you use the keyboard to open the menu (Bug 626825).
    You can see the difference if you use Alt+F to open the File menu or other menus like the Edit menu (Alt+E) and Bookmarks menu (Alt+B) and compare that to what you see if you use the mouse to open the menu after you have made the menu bar visible by tapping Alt or by pressing F10.
    *[https://bugzilla.mozilla.org/show_bug.cgi?id=626825 bug 626825] - Hide redundant menu commands unless the user invokes the menu using the keyboard (make use of the openedWithKey attribute)
    ''(please do not comment in bug reports; you can vote instead)''
    See also:
    * [[/questions/799856#answer-155765]]

  • Can anyone tell me how to install a network printer driver without having the network printer online?

    Can anyone tell me how to install a network printer driver without having the network printer online? It doesn't matter what manufactors make the network printers. Is a netwaork printer(with network card) has to have that printer on line to be able to install
    the driver? This is the point of my question!
    I've ask a same type of question previously, but I can't either get good answer nor reply on the response.

    DP
    The computer (and driver) have to handshake with the printer, QED it has to be either online or physically connected and if it is physically connected it wont work on the network so yes it does.
    Wanikiya and Dyami--Team Zigzag

  • How so i report my ipod stolen without having the serial number?

    how so i report my ipod stolen without having the serial number?

    The easiest way to find your serial number is this Open Itunes...click help... run diagnostics.....(tick or untick as necessary) so that you just have ticked the last two, device connectivity and device sync. run these tests. it will say no ipod/ipad found but will give results of test....scroll down to bottom of results... here you will find the serial number of your last attached devices.

Maybe you are looking for

  • Xorg fails to start, blackscreen with immovable mouse

    Since the last xorg-server update this happened, though I downgraded the package and it didn't fix it.

  • Big hard drive problem after 10.8.5 supplemental update

    Hello, I just tried installing the 10.8.5 supplemental update, but now I can't restart my iMac at all. It keeps trying to reinstall the update, and then shuts down. I can restart from the recovery HD, but I can't reinstall the previous software as it

  • ABAP HR problem - Loans

    In V0 table we have  Var.assign. type    Var.assign.type     Var. assign. info.  and the corresponding information of loan is stored in RT eith wage type /LLB. without quering RT is there any way to find the opening balance and closing balance of loa

  • File not found exception....in jboss

    how to access a .properties file in jboss web application....as when running the jsp code from jboss which in turn invokes the java class file which is using the .properties file we get the file not found exception with respect to the properties file

  • E-63 unwanted noises

    Just after I purchased it and before I put a SIM card into my Nokia E-63, the device was nice and quiet. Now, with a SIM card installed, my E-63 makes noises in middle of night that wake me up--long before the time when the "alarm" is set on the devi