Need help in JSP and Servlets

Hi friends,
[please forgive me if i am posting this in the wrong forum, all seems same to a fresher]
Now, to my problem..i need a suggestion, a way or a method to implement the following!
I am supposed to create a servlet that reads data from oracle database. Once i retrive the data (for example: 6 rows of a table having 4 attributes), i am supposed to pass this data to a JSP page where the data has to be formatted and displayed properly. If i call the same servlet from a different JSP, i should be able to access the data in that JSP and format it in a different way. How do i pass the data to JSP? what method i can use to achieve this task?
Note: I already know about PrintWriter pw = response.getWriter(); and then printing the formated HTML page..but i want to keep the formatting to JSP part and send only the data part that i can access in JSP
Thanks in adavance

arun_ramachandran wrote:
[please forgive me if i am posting this in the wrong forum, all seems same to a fresher]Then you should learn to be more observant - after all, we have JSP and Servlet fora, further down the list. :)
I am supposed to create a servlet that reads data from oracle database. Once i retrive the data (for example: 6 rows of a table having 4 attributes), i am supposed to pass this data to a JSP page where the data has to be formatted and displayed properly. If i call the same servlet from a different JSP, i should be able to access the data in that JSP and format it in a different way. How do i pass the data to JSP? what method i can use to achieve this task? You can store the data in your session object. You can even use JavaBeans and the jsp:usebean tag.
[http://java.sun.com/products/jsp/tags/11/syntaxref11.fm14.html]
Note: I already know about PrintWriter pw = response.getWriter(); and then printing the formated HTML page..but i want to keep the formatting to JSP part and send only the data part that i can access in JSPA wise approach - I wish more prople woiuld be as thoughtful.

Similar Messages

  • Help with jsp and servlets(litterature)

    I'm planning on converting a asp website to jsp and I need to figure out the following:
    1: servlet that gives out connection objects from a pool and manages "lost" connections to a mysql db
    2: a bean that has getConnection and closeConnection that is used on every jsp page.
    3: servlet/bean that can check size/dimesions/filetype on a remote url image
    4: Figure out what users are logged in at every given moment. result: x users are on, these are user1, user2, user3. automatic removal when session runs out. probably need a servlet for this.
    I got these books:
    deitel java how to program 3rd edition
    deitel advanced java 2 platform how to program
    The last book has a servlet and jsp section ut I suspect that java has evolved since then so thats why I'm asking if you have any other suggestions that offer more than 2 chapters. Its really basic the stuff i have :)
    Its been 3 years since I've touched java so i hope you guys can recomend jsp/servlet books that can answer these questions for me and help me get started with this project?
    Thanks :)

    1. apache dbcp commons library.
    http://jakarta.apache.org/commons/dbcp/
    2. tomcat DataSource, which already has the dbpc logic incorporated into it.
    http://tomcat.apache.org/tomcat-5.5-doc/jndi-datasource-examples-howto.html
    3. no idea, google may help
    4. HttpSessionBindingListener. This allows you to monitor when a bean (such as a User bean) is added to the session and when it is removed from the session. This way you can track yourself which users are online.
    http://java.sun.com/j2ee/1.4/docs/api/javax/servlet/http/HttpSessionBindingListener.html

  • Need help in jsp and struts projects

    hi
    i am using jsp and struts framework.
    in that i am putting values in session in one jsp and getting
    values in other jsp.i am having doud with how many values i will put in sessions and it will give any difficulty while running in servers.and i want to know any other equivalent way is there for sessions.

    hi
    i am using jsp and struts framework.
    in that i am putting values in session in one jsp
    jsp and getting
    values in other jsp.i am having doud with how many
    ny values i will put in sessions and it will give any
    difficulty while running in servers.and i want to
    know any other equivalent way is there for sessions.do u want all those vales at the same time? if not then u might use session.removeAttribute() method for trashing out the not needed objects.
    there are many ways of session handling.... passing as request param, also using hidden fields, else th URL rewritting...
    but all these are not efficient to be passed along if too many pages are using the same session objects. i believe u can also try passing it into an XML file and parse it out whenever needed. but i dont think thats feasible enough.
    hope it helps.

  • Need Help with JSP and Soap

    Trying to write a JSP page that pulls information from a Soap Call. Below is the JSP page and the Soap Code. Any Help would be great:
    The soap call needs to come back with a variable in the line: <td class="detail-item-value" colspan="2"><%= request.getobject %>
    The JSP Page:
    <%@page import="java.sql.DriverManager, java.sql.Connection, java.sql.ResultSet, java.sql.Statement"%>
    <nested:define id="recordId" property="detailId" />
    <%
    //String payorId = (String) recordId;
    String payorId = "1001850";
    Set objgetobject = Server.CreateObject("soapdemo.SoapServer")
    getobject = objgetobject.GetPayorByIdRequest(payorId)
    %>
    <table id="detailTable" class="detail-outer-table">
    <tr>
    <td colspan="4"
    class=
    "detail-inner-group-header" >
    <center>Party Attributes</center></td></tr>
    <tr>
    <td colspan="2" class="detail-item-prompt">Test Field</td>
    <td class="detail-item-value" colspan="2"><%= request.getobject %>
    </td>
    </tr>
    <tr>
    <td BGcolor="e4f2f5" class="detail-item-prompt">Customer Name</td>
    <td BGcolor="e4f2f5" class="detail-item-value"><nested:write property="detailValue(stdName1)" filter="false"/></td>
    <td BGcolor="e4f2f5" class="detail-item-prompt">PO Box</td>
    <td BGcolor="e4f2f5" class="detail-item-value"><nested:write property="detailValue(poBox)" filter="false"/></td>
    </tr>
    <tr>
    <td class="detail-item-prompt">Address 1</td>
    <td class="detail-item-value"><nested:write property="detailValue(stdAddr1)" filter="false"/></td>
    <td class="detail-item-prompt">PO Box City</td>
    <td class="detail-item-value"><nested:write property="detailValue(poBoxCity)" filter="false"/></td>
    </tr>
    <tr>
    <td BGcolor="e4f2f5" class="detail-item-prompt">Address 2</td>
    <td BGcolor="e4f2f5" class="detail-item-value"><nested:write property="detailValue(stdAddr2)" filter="false"/></td>
    <td BGcolor="e4f2f5" class="detail-item-prompt">PO Box Region/State</td>
    <td BGcolor="e4f2f5" class="detail-item-value"><nested:write property="detailValue(poBoxState)" filter="false"/></td>
    </tr>
    <tr>
    <td class="detail-item-prompt">City</td>
    <td class="detail-item-value"><nested:write property="detailValue(stdCity)" filter="false"/></td>
    <td class="detail-item-prompt"> </td>
    <td class="detail-item-prompt"> </td>
    </tr>
    <tr>
    <td BGcolor="e4f2f5" class="detail-item-prompt">Region State</td>
    <td BGcolor="e4f2f5" class="detail-item-value"><nested:write property="detailValue(stdState)" filter="false"/></td>
    <td BGcolor="e4f2f5" class="detail-item-prompt">Party ID</td>
    <td BGcolor="e4f2f5" class="detail-item-value"><nested:write property="detailValue(entId)" filter="false"/></td>
    </tr>
    <tr>
    <td class="detail-item-prompt">Zip Code</td>
    <td class="detail-item-value"><nested:write property="detailValue(stdZipCode)" filter="false"/></td>
    <td BGcolor="e4f2f5" class="detail-item-prompt">Last Published</td>
    <td BGcolor="e4f2f5" class="detail-item-value"><nested:write property="detailValue(lastPublished)" filter="false"/></td>
    </tr>
    <tr>
    <td BGcolor="e4f2f5" class="detail-item-prompt">Telephone</td>
    <td BGcolor="e4f2f5" class="detail-item-value"><nested:write property="detailValue(phone)" filter="false"/></td>
    <td BGcolor="e4f2f5" class="detail-item-prompt">Last Changed By</td>
    <td BGcolor="e4f2f5" class="detail-item-value"><nested:write property="detailValue(lastChangeUserName)" filter="false"/></td>
    </tr>
    <tr>
    <td colspan="4"
    class=
    <nested:equal property="isSourceItem" value="false">"detail-first-group-header"</nested:equal>
    <nested:equal property="isSourceItem" value="true">"detail-inner-group-header"</nested:equal>
    <center>Reference Data</center></td></tr>
    <tr>
    <td colspan="2" class="detail-item-prompt" bgcolor="e9eef4"><center>Dun and Bradstreet</center></td>
    <td colspan="2"class="detail-item-prompt" bgcolor="e9eef4"><center>Verispan</center></td>
    </tr>
    <tr>
    <td class="detail-item-prompt">D&B DUNS</td>
    <td class="detail-item-value"><nested:write property="detailValue(dnbDunsNumber)" filter="false"/></td>
    <td class="detail-item-prompt">SMG Business Type</td>
    <td class="detail-item-value"><nested:write property="detailValue(smgBusType)" filter="false"/></td>
    </tr>
    <tr>
    <td BGcolor="e4f2f5" class="detail-item-prompt">Trade Style</td>
    <td BGcolor="e4f2f5" class="detail-item-value"><nested:write property="detailValue(tradestyle)" filter="false"/></td>
    <td BGcolor="e4f2f5" class="detail-item-prompt">SMG ID</td>
    <td BGcolor="e4f2f5" class="detail-item-value"><nested:write property="detailValue(smgId)" filter="false"/></td>
    </tr>
    <tr>
    <td class="detail-item-prompt">Line Of Business</td>
    <td class="detail-item-value"><nested:write property="detailValue(lineOfBusiness)" filter="false"/></td>
    <td class="detail-item-prompt">HIN_ID</td>
    <td class="detail-item-value"><nested:write property="detailValue(hinId)" filter="false"/></td>
    </tr>
    <tr>
    <td BGcolor="e4f2f5" class="detail-item-prompt">Status Code</td>
    <td BGcolor="e4f2f5" class="detail-item-value"><nested:write property="detailValue(statusCode)" filter="false"/></td>
    <td BGcolor="e4f2f5" class="detail-item-prompt">DEA_ID</td>
    <td BGcolor="e4f2f5" class="detail-item-value"><nested:write property="detailValue(deaId)" filter="false"/></td>
    </tr>
    <tr>
    <td class="detail-item-prompt">Subsidiary Code</td>
    <td class="detail-item-value"><nested:write property="detailValue(subsidiaryCode)" filter="false"/></td>
    <td class="detail-item-prompt"> </td>
    <td class="detail-item-value"> </td>
    </tr>
    <tr>
    <td BGcolor="e4f2f5" class="detail-item-prompt"> </td>
    <td BGcolor="e4f2f5" class="detail-item-value"> </td>
    <td BGcolor="e4f2f5" class="detail-item-prompt"> </td>
    <td BGcolor="e4f2f5" class="detail-item-prompt"> </td>
    </tr>
    <tr>
    <td class="detail-item-prompt">Domestic Ultimate DUNS</td>
    <td class="detail-item-value"><nested:write property="detailValue(dnbDomUltimateDuns)" filter="false"/></td>
    <td class="detail-item-prompt"> </td>
    <td class="detail-item-prompt"> </td>
    </tr>
    <tr>
    <td BGcolor="e4f2f5" class="detail-item-prompt">Domestic Ultimate Name</td>
    <td BGcolor="e4f2f5" class="detail-item-value"><nested:write property="detailValue(domUltimateBusinessName)" filter="false"/></td>
    <td BGcolor="e4f2f5" class="detail-item-prompt"> </td>
    <td BGcolor="e4f2f5" class="detail-item-prompt"> </td>
    </tr>
    <tr>
    <td class="detail-item-prompt"> </td>
    <td class="detail-item-value"> </td>
    <td class="detail-item-prompt"> </td>
    <td class="detail-item-prompt"> </td>
    </tr>
    <tr>
    <td BGcolor="e4f2f5" class="detail-item-prompt">Global Ultimate DUNS</td>
    <td BGcolor="e4f2f5" class="detail-item-value"><nested:write property="detailValue(dnbGlobalUltimateDuns)" filter="false"/></td>
    <td BGcolor="e4f2f5" class="detail-item-prompt"> </td>
    <td BGcolor="e4f2f5" class="detail-item-prompt"> </td>
    </tr>
    <tr>
    <td class="detail-item-prompt">Global Ultimate Name</td>
    <td class="detail-item-value"><nested:write property="detailValue(globalUltimateBusinessName)" filter="false"/></td>
    <td class="detail-item-prompt"> </td>
    <td class="detail-item-prompt"> </td>
    </tr>
    <tr><td colspan="4" class="detail-inner-group-header"><center>Database Details</center></td></tr>
    <tr><td class="detail-item-prompt">Created</td>
    <td class="detail-item-value"><nested:write property="detailValue(creationTimestamp)" filter="false"/></td>
    <td class="detail-item-prompt">Last Changed</td>
    <td class="detail-item-value"><nested:write property="detailValue(lastChangeTimestamp)" filter="false"/></td></tr>
    <!-- Future: display creation and last change username after editing is implemented -->
    <nested:equal property="isSourceItem" value="false">
    <tr><td class="detail-item-prompt">Purisma Composite Id</td>
    </nested:equal>
    <nested:equal property="isSourceItem" value="true">
    <tr><td class="detail-item-prompt">Purisma Id</td> </nested:equal>
    <td class="detail-item-value"><nested:write property="detailId" filter="false"/></td>
    <td class="detail-item-prompt"><nested:write property="detailSourceName" filter="false"/></td>
    <td class="detail-item-value"><nested:write property="detailExternalId" filter="false"/></td></tr>
    <!--
    <tr><td colspan="4" class="detail-inner-group-header"><center>Family Tree Information</center></td></tr>
    <tr><td class="detail-item-prompt">Linkage Last Changed</td>
    <td class="detail-item-value"><nested:write property="detailValue(linkageChangeTimestamp)" filter="false"/></td>
    <td class="detail-item-prompt">Linkage Last Edited</td>
    <td class="detail-item-value"><nested:write property="detailValue(linkageEditTimestamp)" filter="false"/></td>
    </tr>
    <tr><td class="detail-item-prompt">Linkage Edited by</td>
    <td class="detail-item-value"><nested:write property="detailValue(linkageEditUserName)" filter="false"/></td></tr>
    -->
    </table>
    SOAP CALL
    <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:urn="urn:purisma-pcr:CUSTOMER">
    <soapenv:Header/>
    <soapenv:Body>
    <urn:GetPayorByIdRequest urn:registryId="?" urn:sourceStartIndex="0" urn:sourcePageSize="0">
    <!--Zero or more repetitions:-->
    <fieldName>?</fieldName>
    </urn:GetPayorByIdRequest>
    </soapenv:Body>
    </soapenv:Envelope>

    Trying to write a JSP page that pulls information from a Soap Call. Below is the JSP page and the Soap Code. Any Help would be great:
    The soap call needs to come back with a variable in the line: <td class="detail-item-value" colspan="2"><%= request.getobject %>
    The JSP Page:
    <%@page import="java.sql.DriverManager, java.sql.Connection, java.sql.ResultSet, java.sql.Statement"%>
    <nested:define id="recordId" property="detailId" />
    <%
    //String payorId = (String) recordId;
    String payorId = "1001850";
    Set objgetobject = Server.CreateObject("soapdemo.SoapServer")
    getobject = objgetobject.GetPayorByIdRequest(payorId)
    %>
    <table id="detailTable" class="detail-outer-table">
    <tr>
    <td colspan="4"
    class=
    "detail-inner-group-header" >
    <center>Party Attributes</center></td></tr>
    <tr>
    <td colspan="2" class="detail-item-prompt">Test Field</td>
    <td class="detail-item-value" colspan="2"><%= request.getobject %>
    </td>
    </tr>
    <tr>
    <td BGcolor="e4f2f5" class="detail-item-prompt">Customer Name</td>
    <td BGcolor="e4f2f5" class="detail-item-value"><nested:write property="detailValue(stdName1)" filter="false"/></td>
    <td BGcolor="e4f2f5" class="detail-item-prompt">PO Box</td>
    <td BGcolor="e4f2f5" class="detail-item-value"><nested:write property="detailValue(poBox)" filter="false"/></td>
    </tr>
    <tr>
    <td class="detail-item-prompt">Address 1</td>
    <td class="detail-item-value"><nested:write property="detailValue(stdAddr1)" filter="false"/></td>
    <td class="detail-item-prompt">PO Box City</td>
    <td class="detail-item-value"><nested:write property="detailValue(poBoxCity)" filter="false"/></td>
    </tr>
    <tr>
    <td BGcolor="e4f2f5" class="detail-item-prompt">Address 2</td>
    <td BGcolor="e4f2f5" class="detail-item-value"><nested:write property="detailValue(stdAddr2)" filter="false"/></td>
    <td BGcolor="e4f2f5" class="detail-item-prompt">PO Box Region/State</td>
    <td BGcolor="e4f2f5" class="detail-item-value"><nested:write property="detailValue(poBoxState)" filter="false"/></td>
    </tr>
    <tr>
    <td class="detail-item-prompt">City</td>
    <td class="detail-item-value"><nested:write property="detailValue(stdCity)" filter="false"/></td>
    <td class="detail-item-prompt"> </td>
    <td class="detail-item-prompt"> </td>
    </tr>
    <tr>
    <td BGcolor="e4f2f5" class="detail-item-prompt">Region State</td>
    <td BGcolor="e4f2f5" class="detail-item-value"><nested:write property="detailValue(stdState)" filter="false"/></td>
    <td BGcolor="e4f2f5" class="detail-item-prompt">Party ID</td>
    <td BGcolor="e4f2f5" class="detail-item-value"><nested:write property="detailValue(entId)" filter="false"/></td>
    </tr>
    <tr>
    <td class="detail-item-prompt">Zip Code</td>
    <td class="detail-item-value"><nested:write property="detailValue(stdZipCode)" filter="false"/></td>
    <td BGcolor="e4f2f5" class="detail-item-prompt">Last Published</td>
    <td BGcolor="e4f2f5" class="detail-item-value"><nested:write property="detailValue(lastPublished)" filter="false"/></td>
    </tr>
    <tr>
    <td BGcolor="e4f2f5" class="detail-item-prompt">Telephone</td>
    <td BGcolor="e4f2f5" class="detail-item-value"><nested:write property="detailValue(phone)" filter="false"/></td>
    <td BGcolor="e4f2f5" class="detail-item-prompt">Last Changed By</td>
    <td BGcolor="e4f2f5" class="detail-item-value"><nested:write property="detailValue(lastChangeUserName)" filter="false"/></td>
    </tr>
    <tr>
    <td colspan="4"
    class=
    <nested:equal property="isSourceItem" value="false">"detail-first-group-header"</nested:equal>
    <nested:equal property="isSourceItem" value="true">"detail-inner-group-header"</nested:equal>
    <center>Reference Data</center></td></tr>
    <tr>
    <td colspan="2" class="detail-item-prompt" bgcolor="e9eef4"><center>Dun and Bradstreet</center></td>
    <td colspan="2"class="detail-item-prompt" bgcolor="e9eef4"><center>Verispan</center></td>
    </tr>
    <tr>
    <td class="detail-item-prompt">D&B DUNS</td>
    <td class="detail-item-value"><nested:write property="detailValue(dnbDunsNumber)" filter="false"/></td>
    <td class="detail-item-prompt">SMG Business Type</td>
    <td class="detail-item-value"><nested:write property="detailValue(smgBusType)" filter="false"/></td>
    </tr>
    <tr>
    <td BGcolor="e4f2f5" class="detail-item-prompt">Trade Style</td>
    <td BGcolor="e4f2f5" class="detail-item-value"><nested:write property="detailValue(tradestyle)" filter="false"/></td>
    <td BGcolor="e4f2f5" class="detail-item-prompt">SMG ID</td>
    <td BGcolor="e4f2f5" class="detail-item-value"><nested:write property="detailValue(smgId)" filter="false"/></td>
    </tr>
    <tr>
    <td class="detail-item-prompt">Line Of Business</td>
    <td class="detail-item-value"><nested:write property="detailValue(lineOfBusiness)" filter="false"/></td>
    <td class="detail-item-prompt">HIN_ID</td>
    <td class="detail-item-value"><nested:write property="detailValue(hinId)" filter="false"/></td>
    </tr>
    <tr>
    <td BGcolor="e4f2f5" class="detail-item-prompt">Status Code</td>
    <td BGcolor="e4f2f5" class="detail-item-value"><nested:write property="detailValue(statusCode)" filter="false"/></td>
    <td BGcolor="e4f2f5" class="detail-item-prompt">DEA_ID</td>
    <td BGcolor="e4f2f5" class="detail-item-value"><nested:write property="detailValue(deaId)" filter="false"/></td>
    </tr>
    <tr>
    <td class="detail-item-prompt">Subsidiary Code</td>
    <td class="detail-item-value"><nested:write property="detailValue(subsidiaryCode)" filter="false"/></td>
    <td class="detail-item-prompt"> </td>
    <td class="detail-item-value"> </td>
    </tr>
    <tr>
    <td BGcolor="e4f2f5" class="detail-item-prompt"> </td>
    <td BGcolor="e4f2f5" class="detail-item-value"> </td>
    <td BGcolor="e4f2f5" class="detail-item-prompt"> </td>
    <td BGcolor="e4f2f5" class="detail-item-prompt"> </td>
    </tr>
    <tr>
    <td class="detail-item-prompt">Domestic Ultimate DUNS</td>
    <td class="detail-item-value"><nested:write property="detailValue(dnbDomUltimateDuns)" filter="false"/></td>
    <td class="detail-item-prompt"> </td>
    <td class="detail-item-prompt"> </td>
    </tr>
    <tr>
    <td BGcolor="e4f2f5" class="detail-item-prompt">Domestic Ultimate Name</td>
    <td BGcolor="e4f2f5" class="detail-item-value"><nested:write property="detailValue(domUltimateBusinessName)" filter="false"/></td>
    <td BGcolor="e4f2f5" class="detail-item-prompt"> </td>
    <td BGcolor="e4f2f5" class="detail-item-prompt"> </td>
    </tr>
    <tr>
    <td class="detail-item-prompt"> </td>
    <td class="detail-item-value"> </td>
    <td class="detail-item-prompt"> </td>
    <td class="detail-item-prompt"> </td>
    </tr>
    <tr>
    <td BGcolor="e4f2f5" class="detail-item-prompt">Global Ultimate DUNS</td>
    <td BGcolor="e4f2f5" class="detail-item-value"><nested:write property="detailValue(dnbGlobalUltimateDuns)" filter="false"/></td>
    <td BGcolor="e4f2f5" class="detail-item-prompt"> </td>
    <td BGcolor="e4f2f5" class="detail-item-prompt"> </td>
    </tr>
    <tr>
    <td class="detail-item-prompt">Global Ultimate Name</td>
    <td class="detail-item-value"><nested:write property="detailValue(globalUltimateBusinessName)" filter="false"/></td>
    <td class="detail-item-prompt"> </td>
    <td class="detail-item-prompt"> </td>
    </tr>
    <tr><td colspan="4" class="detail-inner-group-header"><center>Database Details</center></td></tr>
    <tr><td class="detail-item-prompt">Created</td>
    <td class="detail-item-value"><nested:write property="detailValue(creationTimestamp)" filter="false"/></td>
    <td class="detail-item-prompt">Last Changed</td>
    <td class="detail-item-value"><nested:write property="detailValue(lastChangeTimestamp)" filter="false"/></td></tr>
    <!-- Future: display creation and last change username after editing is implemented -->
    <nested:equal property="isSourceItem" value="false">
    <tr><td class="detail-item-prompt">Purisma Composite Id</td>
    </nested:equal>
    <nested:equal property="isSourceItem" value="true">
    <tr><td class="detail-item-prompt">Purisma Id</td> </nested:equal>
    <td class="detail-item-value"><nested:write property="detailId" filter="false"/></td>
    <td class="detail-item-prompt"><nested:write property="detailSourceName" filter="false"/></td>
    <td class="detail-item-value"><nested:write property="detailExternalId" filter="false"/></td></tr>
    <!--
    <tr><td colspan="4" class="detail-inner-group-header"><center>Family Tree Information</center></td></tr>
    <tr><td class="detail-item-prompt">Linkage Last Changed</td>
    <td class="detail-item-value"><nested:write property="detailValue(linkageChangeTimestamp)" filter="false"/></td>
    <td class="detail-item-prompt">Linkage Last Edited</td>
    <td class="detail-item-value"><nested:write property="detailValue(linkageEditTimestamp)" filter="false"/></td>
    </tr>
    <tr><td class="detail-item-prompt">Linkage Edited by</td>
    <td class="detail-item-value"><nested:write property="detailValue(linkageEditUserName)" filter="false"/></td></tr>
    -->
    </table>
    SOAP CALL
    <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:urn="urn:purisma-pcr:CUSTOMER">
    <soapenv:Header/>
    <soapenv:Body>
    <urn:GetPayorByIdRequest urn:registryId="?" urn:sourceStartIndex="0" urn:sourcePageSize="0">
    <!--Zero or more repetitions:-->
    <fieldName>?</fieldName>
    </urn:GetPayorByIdRequest>
    </soapenv:Body>
    </soapenv:Envelope>

  • Help with JSP and Servlets

    Hi,
    How would I create an editable JSP form from JDBC?
    I know how to retrieve the data from JDBC, but I'm still trying to figure out how to take that table data and format it into a tabluar format that user can make changes to it.
    Thanks,
    Tom
    Message was edited by:
    bztom_33
    Message was edited by:
    bztom_33

    CreateConnection();
    logger.info("Database connection opened in Testimonials");
    String queryText = "LOCK TABLE testimonials WRITE,posting_table WRITE";
    int numOfRows = st.executeUpdate(queryText);
    rs = st.executeQuery(SELECT_QUERY_FROM_TESTIMONIALS);
    logger.info("Query executed postingVeiw");
    String queryText1 = "UNLOCK TABLES";
    int numOfRow = st.executeUpdate(queryText1);
    while(rs.next())
    ClientData client = new ClientData();
    client.setName(rs.getString("name"));
    client.setTestimonial(rs.getString("testimonial"));
    client.setCompany(rs.getString("company"));
    clientList.add(client);
    RequestDispatcher disp = null;
    req.setAttribute("clientlist", clientList);
    String error1 = req.getParameter("");
    disp = req.getRequestDispatcher("testimonial.jsp");
    disp.forward(req,res);
    And call this arraylist from the jsp page
    Cheers
    Varun Rathore

  • Help,JSP and SERVLETS!

    hello:
    i've downloaded ECLIPSE 3.2,TOMCAT 5.5 .
    i tried to build simples examples o servlets but i failed could you please tell me how to proceed?i'm new at this plus i've got a project to do with all this so plz can you give some links to go,i tried but no links was clear.
    i've got to give to my professor an examples executed (servlets,jsp)
    thank you

    HISSO wrote:
    i wil give up on talking about stupid gossip
    you must act professional and i you can't help it's ok
    so plz i juste want help
    i'm so busy finishing my studies
    when it comes to talk about development with tomcat and eclipse together i'm new so i need some advices,so plz let's be serious!
    i'm working hard to finish my project!Try to communicate less like a monkey with electrodes attached to it's genitals. This means stop using words like "plz" and write "please" instead.
    If you want specific help with a specific problem then you should ask a specific question. "help, JSP and SERVLETS" is not a specific question. And you should also note that if your specific question is about Tomcat specifically or Eclipse specifically then you are in the wrong place to begin with.
    So do you want to try again?

  • Interesting single sigon application project using jsp and servlet....Help.

    A customer login's to my website using Enterprise login. I am supposed to have a link on my website to this other website(that also uses our Enterprise login details but hosted by other vendor/company on their server), and when I click this link the customes should automatically get logged in to this other website and get a welcome page(instead of login page).
    Below are the sequence of steps that the other website wants me to perform to get to his welcome page(i.e bypass his login page).
    FYI, I am planning to build a jsp page with a link to this other website. Can some body tell me how should I build the application(i.e) how jsp and servlets be build to interact to perform these operations. Any hep is greatly appreciated.
    1.When a user clicks on to other website link(available on my website), the browser generates an HTTP GET request to the Other website's session servlet. User's name is one of the parameters of this request.
    2.Other website receives the HTTP request and generates a unique session identifier for this user. An HTTP response to the end-user is then sent. The user's name and the session identifier are passed back as parameters in the redirect URL.
    3.The browser sends the HTTP request (GET) to the Verification Service that was specified in the redirect message. The parameters (user name and/or session id) will be passed as URL parameters.
    4.The Verification Service(of other website) authenticates the user. A redirect URL to it's sigon servlet(with parameter's User id and key) is then sent back to the user's browser.
    5.The end-user's browser will perform the redirect (performing an HTTP get operation to Other website's signon servlet with the username and the digest key).
    6.The other website will check if the parameter's passed is the same as the one passed earlier, if the user is who he says he is then he is redirected to the main page of the application.
    7.The browser will then redirect the user to Other website's main page (welcome.jsp).
    There seems's to be many calls to this other website that needs to be performed behind the scenes once a user clicks the link on my website.
    Please suggest and help me out.........
    Edited by: 836726 on Feb 21, 2011 3:41 PM

    Why are you trying to build a whole federated single sign on framework from scratch when you can just use/buy an existing and proven solution instead? There are a lot of security implication and trust issues involved for this so unless you already understand all of those I'd advise you not to re-invent the wheel. There are a lot of products available that do this. Try searching for '<vendor name> Access Manager' or OpenSSO.

  • Need help in jsp & servlet

    Hi All
    Ca any one can help me in creating a star rater using jsp and servlet
    Thx in advance.

    Yes. You can do this as below:
    For eg: You have rating range from 0-5. Rating is : 3.5
    You need images for 1, .1,.2,.3,.5......9. Based on the rating you need call these images. In case 3.5
    for(int counter=0;counter<rating;counter++){
    //call image for 1 number
    //above loops renders 1 rate images thrice, which implies rating is 3, still you have .5 and now you can .5 image.
    Regards,
    Sudheer

  • Deploying a WAR file containing .jsp and servlets (also uses JNI)

    Deploying a WAR file containing .jsp and servlets (also uses JNI) on Windows 2000
    We had problems making it initially work on Sun ONE Web Server 6.0 Service Pack 1 because of lack of good iPlanet Web
    Server documentation on deploying such files.
    This is how we went about it:
    1) Make one of the servlet and JSP (must call another Java Class) web application (.war) examples work with iPlanet Web
    Server.
    C:\iPlanet\Servers\plugins\servlets\examples\web-apps\HelloWorld\HelloWorld.war
    and
    C:\iPlanet\Servers\plugins\servlets\examples\web-apps\jakarta-examples\jarkarta-examples.war
    a) Go to your Web Server Administration to deploy the application using GUI Web Application Deploy.
    (We usually use command line, we experienced some issues with the GUI version, but maybe it is fixed in the new Web Server
    service packs)
    From browser, open http://yourserver:8888/
    Click on Select a Server:Manage
    Click on Virtual Server Class
    Click on https-yourserver
    Click on the Web Applications Tab
    Then, click on Deploy Web Application
    Enter the following -
    WAR File On: Local
    WAR File Path: C:\iPlanet\Servers\plugins\servlets\examples\web-apps\jakarta-examples\jarkarta-examples.war
    Application URI: /jakarta
    Installation Directory: c:\iPlanet\examples\jakarta-examples
    By clicking on OK it deployed the application.
    I can verify that it is deployed by selecting "Edit Web Applications" and I see the following entry:
    Edit     /jakarta     c:/iPlanet/examples/jakarta-examples
    Also, c:/iPlanet/examples/jakarta-examples should have the similar following directory structure ..
    - [images]
    - [jsp]
    - index.html
    - [servlets]
    - [META-INF]
    - [WEB-INF]
    - [classes]
    - [tlds]
    - web.xml
    - index.html
    I restarted the server and accessed it using the following URL from my IE browser:
    http://yourserver/jakarta/index.html
    Then I clicked on the JSP Examples and tried some JSP examples.
    b) Alternatively, you can also deploy the same example from the command-line.
    Make sure C:\iPlanet\Servers\bin\https\httpadmin\bin\ is in your path
    wdeploy deploy      -u /jakarta
              -i yourserver
              -v https-yourserver
              -d c:\iplanet\examples\jakarta-examples
              C:\iPlanet\Servers\plugins\servlets\examples\web-apps\jakarta-examples\jarkarta-examples.war
    Restart the web server (I don't think you have to restart, but .. might as well).
    2)Deploy your web-application
    My Foo.war has the following structure.
    You can use jar tf Foo.war to look at the file contents from command line (assuming you have JDK installed and the bin is
    in your PATH)
    Foo.war
    - [META-INF]
    - [WEB-INF]
    - web.xml
    - [classes]
    - Bar.class
    - MoServlet.class
    - [lib]
    - ThirdParty.jar
    - [natlib]
    - extlib.dll
    - foo.jsp
    Here is our application scenario:
    foo.jsp uses a class call Bar (it is not in any package). The Bar java class uses classes from ThirdParty.jar. The
    ThirdParty.jar in turn uses JNI to load library extlib.dll. foo.jsp also calls /servlet/Mo as well.
    Now to deploy it, do the following:
    (a) Make sure that within foo.jsp, you import the Bar class ( I don't know why you have to do it, but if you don't you get
    JSP compile error).
    <%@page language="java" import="Bar" contentType="text/html"%>
    (b) Check web.xml (for Servlets)
    Within web.xml, make sure you have the following mappings:
    <servlet>
    <servlet-name> MoLink </servlet-name>
    <servlet-class> MoServlet </servlet-class>
    </servlet>
    <servlet-mapping>
    <servlet-name> MoLink </servlet-name>
    <url-pattern> /servlet/Mo </url-pattern>
    </servlet-mapping>
    (c) Deploy the application
    Using command line:
    wdeploy deploy      -u /foo
              -i yourserver
              -v https-yourserver
              -d c:\iplanet\examples\foo-dir
              Foo.war
    (d) Change web-apps.xml file (for picking up ThirdParty.jar)
    It is located in
    C:\iPlanet\Servers\https-yourserver\config
    You should see something similar to following after successful deployment.
    <web-app uri="/foo" dir="C:\iPlanet\examples\foo-dir" enable="true"/>
    Change it to look like following to pick up the ThirdParty.jar
    <web-app uri="/foo" dir="C:\iPlanet\examples\foo-dir" enable="true">
    <class-loader reload-interval="300"
              classpath="C:/iPlanet/examples/foo-dir/WEB-INF/lib/ThirdParty.jar"
              delegate="false"/>
    </web-app>
    (e) Change jvm12.conf file (for JNI)
    It is located in
    C:\iPlanet\Servers\https-yourserver\config
    Add or uncomment the following lines:
    #optional - just helps with instrumenting the jsp and servlet code
    jvm.include.CLASSPATH=1
    jvm.enableDebug=1
    nes.jsp.enabledebug=1
    jvm.trace=7
    jvm.verboseMode=1
    #required for JNI
    java.compiler=NONE
    jvm.classpath=.;C:\JDK1.3.1\lib\tools.jar;C:/iPlanet/Servers/plugins/servlets/examples/legacy/beans.10/SDKBeans10.jar;
    jvm.option=-Xrs
    jvm.option=-Xnoagent
    # not sure if this is needed for iPlanet web server
    jvm.option=-Djava.library.path=C:/iPlanet/examples/foo-dir/natlib/ -Djava.compiler=NONE
    (f) Change magnus.conf file (for JNI)
    We HAD to change this file in order for ThirdParty.jar file to pick up the native C++ code using JNI. Apparently, the
    iPlanet Web Server doesn't pick the Environment Variable Path. Because when we had the directory containing the DLL just
    in Path, it didn't work.
    Change Extrapath directive:
    ExtraPath C:/iPlanet/Servers/bin/https/bin;${NSES_JRE_RUNTIME_LIBPATH}
    to
    ExtraPath c:/iPlanet/examples/foo-dir/natlib;C:/iPlanet/Servers/bin/https/bin;${NSES_JRE_RUNTIME_LIBPATH}
    (g) Apply changes from the Web Server Administration Console and Restart the web server.
    You should be able to see the behaviour that you want from your application.
    http://yourserver/foo/foo.jsp
    Hope this was helpful!!!
    Sonu

    Deploying a WAR file containing .jsp and servlets (also uses JNI) on Windows 2000
    We had problems making it initially work on Sun ONE Web Server 6.0 Service Pack 1 because of lack of good iPlanet Web
    Server documentation on deploying such files.
    This is how we went about it:
    1) Make one of the servlet and JSP (must call another Java Class) web application (.war) examples work with iPlanet Web
    Server.
    C:\iPlanet\Servers\plugins\servlets\examples\web-apps\HelloWorld\HelloWorld.war
    and
    C:\iPlanet\Servers\plugins\servlets\examples\web-apps\jakarta-examples\jarkarta-examples.war
    a) Go to your Web Server Administration to deploy the application using GUI Web Application Deploy.
    (We usually use command line, we experienced some issues with the GUI version, but maybe it is fixed in the new Web Server
    service packs)
    From browser, open http://yourserver:8888/
    Click on Select a Server:Manage
    Click on Virtual Server Class
    Click on https-yourserver
    Click on the Web Applications Tab
    Then, click on Deploy Web Application
    Enter the following -
    WAR File On: Local
    WAR File Path: C:\iPlanet\Servers\plugins\servlets\examples\web-apps\jakarta-examples\jarkarta-examples.war
    Application URI: /jakarta
    Installation Directory: c:\iPlanet\examples\jakarta-examples
    By clicking on OK it deployed the application.
    I can verify that it is deployed by selecting "Edit Web Applications" and I see the following entry:
    Edit     /jakarta     c:/iPlanet/examples/jakarta-examples
    Also, c:/iPlanet/examples/jakarta-examples should have the similar following directory structure ..
    - [images]
    - [jsp]
    - index.html
    - [servlets]
    - [META-INF]
    - [WEB-INF]
    - [classes]
    - [tlds]
    - web.xml
    - index.html
    I restarted the server and accessed it using the following URL from my IE browser:
    http://yourserver/jakarta/index.html
    Then I clicked on the JSP Examples and tried some JSP examples.
    b) Alternatively, you can also deploy the same example from the command-line.
    Make sure C:\iPlanet\Servers\bin\https\httpadmin\bin\ is in your path
    wdeploy deploy      -u /jakarta
              -i yourserver
              -v https-yourserver
              -d c:\iplanet\examples\jakarta-examples
              C:\iPlanet\Servers\plugins\servlets\examples\web-apps\jakarta-examples\jarkarta-examples.war
    Restart the web server (I don't think you have to restart, but .. might as well).
    2)Deploy your web-application
    My Foo.war has the following structure.
    You can use jar tf Foo.war to look at the file contents from command line (assuming you have JDK installed and the bin is
    in your PATH)
    Foo.war
    - [META-INF]
    - [WEB-INF]
    - web.xml
    - [classes]
    - Bar.class
    - MoServlet.class
    - [lib]
    - ThirdParty.jar
    - [natlib]
    - extlib.dll
    - foo.jsp
    Here is our application scenario:
    foo.jsp uses a class call Bar (it is not in any package). The Bar java class uses classes from ThirdParty.jar. The
    ThirdParty.jar in turn uses JNI to load library extlib.dll. foo.jsp also calls /servlet/Mo as well.
    Now to deploy it, do the following:
    (a) Make sure that within foo.jsp, you import the Bar class ( I don't know why you have to do it, but if you don't you get
    JSP compile error).
    <%@page language="java" import="Bar" contentType="text/html"%>
    (b) Check web.xml (for Servlets)
    Within web.xml, make sure you have the following mappings:
    <servlet>
    <servlet-name> MoLink </servlet-name>
    <servlet-class> MoServlet </servlet-class>
    </servlet>
    <servlet-mapping>
    <servlet-name> MoLink </servlet-name>
    <url-pattern> /servlet/Mo </url-pattern>
    </servlet-mapping>
    (c) Deploy the application
    Using command line:
    wdeploy deploy      -u /foo
              -i yourserver
              -v https-yourserver
              -d c:\iplanet\examples\foo-dir
              Foo.war
    (d) Change web-apps.xml file (for picking up ThirdParty.jar)
    It is located in
    C:\iPlanet\Servers\https-yourserver\config
    You should see something similar to following after successful deployment.
    <web-app uri="/foo" dir="C:\iPlanet\examples\foo-dir" enable="true"/>
    Change it to look like following to pick up the ThirdParty.jar
    <web-app uri="/foo" dir="C:\iPlanet\examples\foo-dir" enable="true">
    <class-loader reload-interval="300"
              classpath="C:/iPlanet/examples/foo-dir/WEB-INF/lib/ThirdParty.jar"
              delegate="false"/>
    </web-app>
    (e) Change jvm12.conf file (for JNI)
    It is located in
    C:\iPlanet\Servers\https-yourserver\config
    Add or uncomment the following lines:
    #optional - just helps with instrumenting the jsp and servlet code
    jvm.include.CLASSPATH=1
    jvm.enableDebug=1
    nes.jsp.enabledebug=1
    jvm.trace=7
    jvm.verboseMode=1
    #required for JNI
    java.compiler=NONE
    jvm.classpath=.;C:\JDK1.3.1\lib\tools.jar;C:/iPlanet/Servers/plugins/servlets/examples/legacy/beans.10/SDKBeans10.jar;
    jvm.option=-Xrs
    jvm.option=-Xnoagent
    # not sure if this is needed for iPlanet web server
    jvm.option=-Djava.library.path=C:/iPlanet/examples/foo-dir/natlib/ -Djava.compiler=NONE
    (f) Change magnus.conf file (for JNI)
    We HAD to change this file in order for ThirdParty.jar file to pick up the native C++ code using JNI. Apparently, the
    iPlanet Web Server doesn't pick the Environment Variable Path. Because when we had the directory containing the DLL just
    in Path, it didn't work.
    Change Extrapath directive:
    ExtraPath C:/iPlanet/Servers/bin/https/bin;${NSES_JRE_RUNTIME_LIBPATH}
    to
    ExtraPath c:/iPlanet/examples/foo-dir/natlib;C:/iPlanet/Servers/bin/https/bin;${NSES_JRE_RUNTIME_LIBPATH}
    (g) Apply changes from the Web Server Administration Console and Restart the web server.
    You should be able to see the behaviour that you want from your application.
    http://yourserver/foo/foo.jsp
    Hope this was helpful!!!
    Sonu

  • How to upload a file into server using j2ee jsp and servlet with bean?

    How to upload a file into server using j2ee jsp and servlet with bean? Please give me the reference or url about how to do that. If related to struts is more suitable.
    Anyone help me please!

    u don't need j2ee and struts to do file uploading. An example is as such
    in JSP. u use the <input> file tag like
    <input type="file"....>You need a bean to capture the file contents like
    class FileUploadObj {
        private FormFile srcFile;
        private byte[] fileContent;
        // all the getter and setter methods
    }Then in the servlet, you process the file for uploading
        * The following loads the uploaded binary data into a byte Array.
        FileUploadObj form = new FileUploadObj();
        byte[] byteArr = null;
        if (form.signFile != null) {
            int filesize = form.srcFile.getFileSize();
            byteArr = new byte[filesize];
            ByteArrayInputStream bytein = new ByteArrayInputStream (form.srcFile.getFileData());
            bytein.read(byteArr);
            bytein.close();
            form.setFileContent(byteArr);
        // Write file content using Writer class into the destination file in the server.
        ...

  • Implement SSL in JSP and servlets

    hi there,
    i needed some help in implementing ssl in JSPs and servlets. My idea was to have a login page and also use it where sensitive data is being sent. I have used the basic socket programming (socket.class and serverSocket.class) in GUI applications using threads to listen and send simultaniously and understand how it works but how do I implement it in JSP and servlets and where do i store the certificate?
    i do know that using SSL sockets is very much the same as using the normal sockets.
    can anyone tell me any useful links or give me a step by step guide how to implement it and which classes to use
    your help would be very much appreciated.
    mani

    hi,
    soory for late reply.
    i think you need to use keytool program in your JDK to generate a certificate signature file and you need to configure the server.xml to open and use the HTTPS port. I have not had any additional info on this but i would assume that you simply enter https:// on the file you wish to load in your form and it should use the HTTPS port provided it can find the certificate which must be stored somewhere in your tomcat web server. i would recommend you see tomcat website or search on google for "ssl support in tomcat".i hav not had time to look into this but i will as soon as i am free from my work load.
    mani

  • How to setup my computer to run JSP and Servlets

    I want to setup my computer to run JSP and Servlets.
    What kind of Servers and other tool i need to install to run JSP and Servlets.
    Plz, Help me to start my work on JSP.
    Regards,
    Usman Ali

    hello
    JSP and servlet is web programming, may be little bit different to development local application.
    1st, you should have two computers: one is server and the other is local workstation. This server should have a static IP address, that other people can go into your server. Workstation is any computer normal you use it.
    2nd, you need to setup your server in: OS(linux or windows 2000), web server (jrun, apach or Tomcat etc. ), as well as install JDK, servlet.
    3rd, your local workstation just use as programming editor and open a browser to testing, anytime you write your code, then ftp to server to test.
    Reality, you have many technical thing to solve, eg setup web server etc. However, you can write your source code and test it, then open to outside people.
    hope to helpness, if anything don't uderstand, you can post again or send email to me [email protected] Since I just have setup this configuration in my university for my project.

  • Help with JSP and logic:iterate

    I have some queries hope someone can help me.
    I have a jsp page call request.jsp:
    ====================================
    <%@ page import="java.util.*" %>
    <%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean" %>
    <%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic" %>
    <html>
    <body>
       <%@ page import="RequestData" %>
       <jsp:useBean id="RD" class="RequestData" />
       <%Iterator data = (Iterator)request.getAttribute("Data");%>
       <logic:iterate id="element" name="RD" collection="<%=data%>">
          <jsp:getProperty name="RD" property="requestID" />
          <%=element%><br>
       </logic:iterate>
    </body>
    </html>
    And I have the RequestData.java file:
    ======================================
    private int requestID = 1234;
    public int getRequestID() { return requestID; }
    The jsp page display:
    ======================
    0 RequestData@590510
    0 RequestData@5b6d00
    0 RequestData@514f7f
    0 RequestData@3a5a9c
    0 RequestData@12d7ae
    0 RequestData@e1666
    Seems like the requestID is not returned. Does anybody know this?
    I have done the exact one using JSP and servlets, trying to learn using JSP and custom tags. The one with JSP and servlet looks like:
    ============================================
    <%@ page import="RequestData" %>
    <%Iterator data = (Iterator)request.getAttribute("Data");
    while (data.hasNext()) {
       RequestData RD = (RequestData)data.next();
       out.println(RD.getRequestID() );
    }%>

    Oh think I got it...
    but one thing I'm not sure is...
    If I use "<jsp:useBean id="RD" class="RequestData" />", do I still need "<%@ page import="RequestData" %>"?
    I tried without and it gives me error...

  • Needs to install JSP and related things!!

    hi All,
    I am new to java web-related areas though I am in Java platform for years. I want to set up JSP & Servlet development area with RedHat Linux OS and MySQL database with Tomcat server. Can u tell me what are the new versions of these are compatible with each other or with any website regarding this. Thanks in advance.
    -bh_t_76.

    Hi
    You just need to visit http://jakarta.apache.org and download any version of Tomcat for Linux available freely. I am now aware about any other web containers for Linux platform althought I have worked with Jrun, Orion Application Server and Sun's J2EE Server on windows.
    For the configuration, you can refer to any book for JSP and servlet. Most of the books contains details of installation, configuration and running of Tomcat.
    I am in the process of learning JSP and servlets on Windows as well as Linux (I have Red Hat Fedora Core Project 1). So, I have told what I know till now. Hope that will help u.
    Also, if you are interested in keeping touch with me for the development and learning purpose, so that we can share a few things about Java, I am listing my email address. it is [email protected]
    All the best.

  • Basic jsp and servlet question (JSP Model 2)

    Hi
    I want to make an website where i use JSP Model 2 architecture. However I got a basic question
    1. I need to separate business logic from presentation with the use of jsp and servlets. Meaning I want no html code in the servlet. Can you give a simple example of how this can be done? If I map my implementation of httpServlet to a jsp page in web.xml and override doPost() and doGet(). The calls to the jsp page comes to the servlet as it should. I want to process some methods (calling sessionbeans or similar which in turn calls entitybeans) and then show the jsp page.
    How do I show the jsp page without mixing html in the servlet as I've done below:
    doGet(HttpServletRequest req, HttpServletResponse res)
    PrintWriter p = response.getWriter();
    p.print("<html><body>Hello world</body></html>"); //I dont want to do //this, I want to display the JSP site
    doPost(HttpServletRequest req, HttpServletResponse res)
    //doSomething
    }Message was edited by:
    CbbLe

    You should treat your servlet class much like a controller, where you can then use JSP as the view. The way you achieve this is to use the forward() method in RequestDispatcher.
    Say you've got a servlet class org.yoursite.controller.YourController:
    public void doGet(HttpServletRequest req, HttpServletResponse resp)
      throws ServletException, IOException {
      //Set some value for use in the JSP file associated wth me
      req.setAttribute("greeting", "Hello world!");
      //Done with our business logic, off we go to the JSP file
      ServletContext app = getServletContext();
        RequestDispatcher disp;
        disp = app.getRequestDispatcher("/some/jsp/file.jsp);
        disp.forward(req, resp);
    }Now in your JSP file:
    <h1>Example</h1>
    <div>
      I just want to say <%= request.getAttribute("greeting") %>
    </div>Going to that servlet now executes business logic and then points to the JSP file for the view. You can forward from servlet to servlet too if needs be. The string you pass to forward() is whatever would be in the URI of the request so any <servlet-mapping> configurations in web.xml are used ;)
    There is some pretty in-depth documentation on the J2EE blueprints website, namely service-to-worker and front-controller patterns. I dare say if you're looking for this sort of code you'll want to look at the composite view pattern too (also on blueprints).

Maybe you are looking for