Query about servlet

sir,
i am facing some problem and problem is below
1if i enter the value in html form then there should be checking that all form is filled if not filled completely then return this page marking the empty field
2.my jsp page return a list of book.i want this list is clickable and after clicking
on this page new page will open in which book name is filled an ask for another field
3. i want to insert hyperlink at last page to visit first page .
4 how i can provide facility of log in and log out

Below is some code that will easily show you what to do:
Retrieve the values sent in the URL by the form and other,
Changing the contents of the compiled jsp page according to input values.
How to make hyperlinks with a identification value.Below is the code for the validation part of the Login.jsp.
To do the login part:
test to see if name and password are correct and if so:
use the setAttribute(?,?) method of the session class to store login status.
then response.sendRedirect(?) with ? being the new page name to redirect to the new page if login was successful.
<%
//Login.jsp
String name = request.getParameter("Name");
String password = request.getParameter("Password");
boolean isFirstLoad = false;
if(name == null || password == null){
  isFirstLoad = true;
  name = "";
  password = "";
%>
<html>
  <body>
    <form action="" method="Post">
      <input type="text" value="" name="Name"/>
<%  if(!isFirstLoad && name.matches("[a-zA-Z0-9]+")){ out.println("Name not Valid");}%>
      <br/>
      <input type="text" value="" name="Name"/>
<%  if(!isFirstLoad && password.matches("[a-zA-Z0-9]+")){ out.println("Password not Valid");}%>
      <br/>
      <input type="submit" value="Submit"/>
    </form>
  </body>
</html>----------------
BookList.jsp
The data that required is the following:
UniqueBookID, Title, Author
<%
//Code to check if logged in or not
%>
<html>
<body>
<table>
<%
Books book = new Books(wsServerCommunicator.getAllBooks());
while(book.getNextBook()){
  out.println("<a href=\"BookDetails.jsp?id=" + book.getUniqueID + "\">");
  out.println("<tr>");
  out.println("<td>" + book.getTitle() + "</td>");
  out.println("<td>" + book.getAuthor() + "</td>");
  out.println("</tr></a>");
%>
</table>
</body>
</html>In the BookDetails.jsp page you will use
String BookID = request.getParameter("id");to deturmine the selected book.
Use the BookID value to retrieve the correct books details.

Similar Messages

  • Query about servlet traversal

    Hello All,
    I want to send a request from one servlet to other servlet without using the url-pattern of the second servlet.
    First servlet should track the request and do some processing and forward it to other servlet which is registered using servlet name and class and no url-pattern is specified. One the request is recieved, the servlet will do the processing and forward it to the application.
    Here when I am using RequestDispatcher, it is forwarding me to the page for e.g.
    In RequestDispatcher I am writing the code as follows.
    RequestDispatcher dispatcher= httpservletrequest.getRequestDispatcher("com.bea.p13n.ad.servlets.AdClickThruServlet");
    dispatcher.forward( httpservletrequest, httpservletresponse );
    Here it cannot find the path "com.bea.p13n.ad.servlets.AdClickThruServlet" since it is considering it as a URL, but I want the application to consider it as a servlet and get into the class specified and do the processing, ut it is not doing so.
    Is there any way to handle this situation ?
    Thanks and regards,
    Sachin Powale

    Basically it is a weblogic servlet which we cannot touch and calling the servlet as a class is not allowed from 2.1 onwards for security reasons.
    Thus the issue.
    Waiting for reply.
    Thanks and regards,
    Sachin Powale

  • Query about local storage

    Hi,
         i had a query about local storage.
         I've a machine that hosts weblogic and tangosol. i've an ejb that accesses a distributed cache i.e NamedCache cache = CacheFactory.get("MyCache")
         i modified tangosol-coherence.xml and set local-storage to false ( for distributed cache) and replaced the file in coherence.jar.
         i'm using an overflow scheme and the back map uses a disk scheme.
         i also start a separate standalone instance of tangosol and i set the system property of local storage to true for the standalone instance.
         i start the standalone instance first and then weblogic.
         The idea is ensure that the tangosol instance in weblogic or the weblogic JVM should not participate in storing data (hence local storage false).
         only the JVM for the standalone instance should store data (hence local storage true -system property).
         i wanted to know whether the property "local-storage" is pertinent to a member(machine) or to a JVM?
         the reason for this doubt: as i'm using a disk scheme, tangosol creates a file for an overflow (e.g lh014402~.tp). i can see two such files when ideally i would have wanted only one for the tangosol instance.
         -rw-r--r-- 1 zephyr users 8364032 2005-06-23 17:02 lh014402~.tp
         -rw-r--r-- 1 zephyr users 8364032 2005-06-23 17:02 lh014403~.tp.
         can you please let me know if we can configure tangosol in such a way that we can two separate instances running with local stroage false for one and true for the other?
         Awaiting your reply
         Thanks
         Vinay

    I would suggest leaving the default 'local-storage' value set to 'true' in the tangosol-coherence.xml and just use the JVM argument to control the local storage of each individual node. Then start the stand alone instance normally (I assume you are using the com.tangosol.net.DefaultCacheServer) and start the WebLogic instance with the following:
         java [...] -Dtangosol.coherence.distributed.localstorage=false [...]
         Hope this helps.
         Later,
         Rob Misek
         Tangosol, Inc.

  • Big Troubles on designing Query about special customers' counting

    Hello buddies:
    I meet a problem on designing Query about special customers' counting. Let me describe the requirment first.  I want to create a query with BEX , and there is a key figure with very special logic.
    That is: to list the counts of the customers which has more than one sales records in a time period from sales data. 
    For example :
    when the user excute the query , he or she must input a time period ( 2007.01~2007.03 e.g)
    then the query output as follow:
    District          Cust-sount
    North-Zone       100
    South-Zone      120
    The Main trouble are :
    1. Threr are no document number in the detail of sales data document records. so I could not count the sales times with document number.
    2. The time period is not fixed value, it depends on the user's input, so I can not define the counting logic in the update rule or in the query with fixed time period.
    Anybody who met similar requirement pls show me your hand and give your solutions, thanks very much.
    Jason

    Hi,
        Your solution sounds a good way to count the distinct customers. but in my case, one salse line item must not be recognize as one sales record, instead,  one customer's all sales line items occurs in one day must be  recognize as one sales record ( or we say that one sales behavior).
    for example:
    customer     product    quantity   date
    cust001       prod001        10       2007.06.06
    cust001       prod002        20       2007.06.06
    the two line items above means one sales record for the customer "cust001".
    so I could not simply use the CKF : (( Counter ) *FV2 ) > 1 .
    Best Regards,
    Jason

  • Query about licensing Jdeveloper

    Dear Friends,
    I have a query about licensing of Jdeveloper development tool. I understand that Jdeveloper is Free tool.That is we do not require license to use Jdeveloper for development as well as production.
    Recent I heard that Jdeveloper is free only if we purchase Oracle Application Server. Is it correct ? Does one need to purchase Jdeveloper license if it is being deployed on any other App. server eg. Jboss etc ?
    Can anyone throw light on the same ?
    Many thanks,
    Vaij

    Hi,
    JDeveloper is free! Oracle ADF - the binding layer - ADF BC, and ADF Faces need an OracleAs licence
    Frank

  • New issue in R 12.1.3 in AP while query about inovice was recorded in AP

    i record new invoice in ap on release R 12.1.3 and when query about it on invoice form the error appeare was it
    forms
    FRM-40735:POST-QUERY trigger raised unhandled exception ORA-04063
    how can someone help us

    Hi,
    Please see these docs.
    R12:Getting FRM-40735 Post-Query Trigger On Quering Invoice [ID 1209736.1]
    After Applying Patch APXINWKB.fmb Is Not Working [ID 1159124.1]
    R12.1.1 APXINWKB Invoice Workbench Form Comes Up With 'ORA-01403' [ID 949942.1]
    12.1.1: FRM-40735: Post-Query Trigger Raised Unhandled Exception ORA-04063 [ID 1077613.1]
    Query on Invoices, Getting "FRM-40735: POST-QUERY trigger raised unhandled exception ORA-4063" [ID 1076609.1]
    Thanks,
    Hussein

  • I want to learn more about "Servlet".Where can I find that document.

    Hi ! all.
    I am really need to know about Servlet technology programming.
    Please! anyone can tell me.
    Thank you very much!

    for basics go to "JAVA How to program"
    visit dietel & dietel website
    regards
    Amar(india)

  • I have one query about table entries.

    i have one query about table entries.
    suppose  for particular table we maintained   5 entries in dev server. actaully in the dev we have only these 5 entries.
    In production we have 200 entries actually.
    If we move the cts from  dev  to production ,we will get 205 entries right
    please help me in this.

    If i understood correctly, It is a Z table and you have done some changes in DEV system. If you move this to Production, it wont effect the production entries.
    There are 2 different ways you can trnasport a Table. 1. with Table entries 2. Without table entries.
    If you transport with Table entries then the DEV entries in this case 5 will be moved to PRODUCTION totaling 205.
    If you transport without table entries, then in Production you will find only 200 entries.

  • Two questions about servlets

    Hi,
    I'd like to ask you some questons about servlets :
    1) do servlets need a particular JVM on the server. I mean RMI servers need to be started on the server side, while usual applets are loading into the client browser. Are servlet beeing loaded by the browser or do they require something specific on the server side?
    This is because I can only post files on my server, but can't execute java code
    2) can servlets access the server files ? This is because my applets can only load files within the codebase directory on the server. However, i'd like to be able to get something like File.lisFiles() on the server's content. With applets, I have a security problem
    Thanks a lot.
    vincent

    Hi,
    1) Servlets need to be run (deployed) on an application server (i.e. WebLogic, Websphere) which works in conjunction with the web server. When the web server (HTTP Server) receives a request for a servlet from a browser, it passes the request to the application server where the servlet is deployed on which handles the request and provides a response. The JVM will be included in the application server.
    2) Servlets do NOT run in the sandbox that applets run in and thus have complete access to file on the server. This is because the site running the servlets know exactly what code they're deploying on their server and thus have no security concerns.
    If you're site is running on an ISP's server, then you're likely out of luck unless they give you admin access to an application server that runs on their server which allows you to deploy servlets onto.
    makes sense?...
    vc

  • Query about the DR -Standby

    Hi Support,
    I have a query about the DR -Standby:
    1) Is FAL_CLIENT and FAL_SERVER parameter mandatory in both Primary and standy node?
    2) How many standy by we can create for primary node?
    Thanks

    Dear Prashanth,
    Quantity of 3 is rejected so you blocked it? why you want to bring it again to Quality? Use of putting in block is as follows:
    Since quantity of 3  is rejected  and need to be kept aside you are blocking the stock, the purchase person will send back this material to vendor directly from block stock (MBRL or MIGO). This is best practice.
    There can be other situation that your vendor came to your place and done rework om that 3 blocked items and you are satisfied with the quality then you can use respective movement for transferring from block to unrestricted, if you want lot to be generated then assign 08 insp type and do inspection.
    Hope this will help you better.
    Best Regards,
    Shekhar

  • Query about the "User Decision

    Hi,
    I have a query about the u201CUser Decisionu201D, Suppose I have received the 10 quantity and lot get created for 10. At time of UD (QA11) I put 7 quantities in unrestricted and 3 in blocked stock .what we generally use to do with that block stock? Whether we again transfer it to quality stock (Movement 349)? Or move directly to unrestricted (movement: 343).
    I tried to move the blocked stock in u201Cquality stocku201D in transaction MB1B with movement 349 but it had given error u201CChange the inspection stock of material 9112223334A in QM onlyu201D. In QM how to transfer the blocked stock in quality stock?
    Regards,
    PK

    Dear Prashanth,
    Quantity of 3 is rejected so you blocked it? why you want to bring it again to Quality? Use of putting in block is as follows:
    Since quantity of 3  is rejected  and need to be kept aside you are blocking the stock, the purchase person will send back this material to vendor directly from block stock (MBRL or MIGO). This is best practice.
    There can be other situation that your vendor came to your place and done rework om that 3 blocked items and you are satisfied with the quality then you can use respective movement for transferring from block to unrestricted, if you want lot to be generated then assign 08 insp type and do inspection.
    Hope this will help you better.
    Best Regards,
    Shekhar

  • Query about multiple connection pools under one database

    Hi,
    I have s query about connection pool, now we have a requirement,
    we have two schemas in one db, some data store in one schema, some in another schema,
    all tables are the same, but data is different, we want to retrive all data under two schemas,
    so we need two connection pools under one database,
    I have set two system DSN, and each connection pool was mapping to one DSN,
    but after I importing tables into RPD, when I view data, there is a dialog let me select connection pool. so If this, when we drag columns in answer, it will definitely get wrong.
    so how to realize this function about multiple connection pools under one database and we can get data normally.

    Hi,
    Try this step
    1)Better to create two different DSN for the same database with different user id and password
    2)now create multiple connection pool in the same database in u r RPD physical layer .
    also refer this link : for imporving performance
    http://obiee101.blogspot.com/2009/01/obiee-multiple-connection-pools.html
    http://gerardnico.com/wiki/dat/obiee/connection_pool
    Thanks
    Deva

  • Query about account hierarchy

    i want a query about account hierarchy
    like if i have asset 1000
    fixed asset 1100
    land 1110
    i want the result from query:
    asset 1000
    fixed asset 1100 1000
    land 1110 1100
    the last column is parent

    Try this
    SELECT ffv.flex_value, maptl.parval
      FROM apps.fnd_flex_values ffv,
           (SELECT ffvc.flex_value chval, ffvh.parent_flex_value parval
              FROM apps.fnd_flex_values ffvr1,
                   apps.fnd_flex_values ffvr2,
                   apps.fnd_flex_values ffvc,
                   apps.fnd_flex_value_hier_all ffvh
             WHERE ffvh.child_flex_value_low = ffvr1.flex_value
               AND ffvh.child_flex_value_high = ffvr2.flex_value
               AND ffvc.flex_value_id BETWEEN ffvr1.flex_value_id
                                          AND ffvr2.flex_value_id
               AND ffvr1.flex_value_set_id = :val_set_id
               AND ffvr2.flex_value_set_id = :val_set_id
               AND ffvc.flex_value_set_id = :val_set_id
               AND ffvh.flex_value_set_id = :val_set_id) maptl
    WHERE ffv.flex_value = maptl.chval(+)
    AND ffv.flex_value_set_id = :val_set_id
    ORDER BY ffv.flex_valueThis takes value set id as an input parameter.
    HTH

  • Another query about XAResource

    Hi All,
    I have another query about the start/end behavior of the XAResource and its effect on a JMS transaction when the JMS server acts as a resource manager.
    Suppose I start an XAResource supplied by a JMS server using an XID and pop some messages from a Queue in this transaction. Now before I end this transaction my client application dies or is disconnected from the server.
    First off this transaction has not been committed or rollbacked so the transaction or the XID would still be registered on the server.
    In this case what should be the steps for joining this transaction and doing the needful (say commit or rollback).
    What flag should be used to re-start this resource?
    Is there any specs defined for the above or as many other things in XA for JMS servers are, is this also vendor specific?
    Thanks in advance for your answers.
    cheers
    Adolf

    Hi Adolf,
    XAResource is used to provide a two phase commit.
    1 prepare
    2 commit
    now say a client fails before prepare, then the server detects that the client has gone down and so closes the connection which causes the whole transaction to roll back. Next time the clients has to begin it afresh.
    if the transaction has been prepared, the prepared transaction can be actually commited by the TM. this stage is for all the components of the dustributed system to say that they are ready for commiting.

  • Urgent query about copying array of objects to html item

    I have an urgent query about how I can display an array of objects on a html form. The only suitable html item I can see for this is a drop down box. Ideally a combo box would be preferable but I cant find anything like this. Basically the display item needs to contain 3 columns of data and has to display a number of rows. Can anyone tell me how to copy the array of values into a drop down box?

    Here is all the code from my jsp. It keeps returning null:
    <%@ page language="java" %>
    <%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean" %>
    <%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html" %>
    <%@ page import="java.util.*, java.lang.*" %>
    <html:html locale="true">
    <head>
    <meta HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=windows-1252"/>
    <link rel="stylesheet" type="text/css" name="timesheet" href="stylesheets/timesheet.css"></link>
    <script type="text/javascript" language="javascript" src="javascript/sum.js"></script>
    <title><bean:message key="eng.title"/></title>
    <html:base/>
    </head>
    <body bgcolor="white">
    <table border="0" width="100%">
    <tr>
    <td width="30%"><html:img page="/images/PwC_logo.gif"/></td>
    <td width="40%" class="applicationTitleCell">
    <div align="center">
    <bean:message key="application.title"/>
    </div>
    </td>
    <td width="30%"> </td>
    </tr>
    </table>
    <center>
    <html:form action="/selectEng" focus="engSearchNumber">
    <table border="0" width="100%">
    <tr>
    <td width="30%"></td>
    <td width="20%" align="center"> <b> <bean:message key="eng.prompt.engSearchNumber"/> </b> </td>
    <td width="20%" align="center"> <b> <bean:message key="eng.prompt.clientSearchName"/> </b> </td>
    <td width="40%">   </td>
    </tr>
    <tr>
    <td width="30%"></td>
    <td width="20%" align="center"> <html:text property="engSearchNumber" size="20" maxlength="9" onchange='<%= "SearchLength(this)" %>' onkeypress="return NumberOnly()" /> </td>
    <td width="20%" align="center"> <html:text property="clientSearchName" size="20" maxlength="20" onchange='<%= "SearchLength(this)" %>'/> </td>
    <td width="30%">   </td>
    </tr>
    </table>
    <table border="0" width="100%">
    <tr>
    <td width="30%"></td>
    <td width="40%" align="center"><html:image property="findButton" src="images/Find.gif" alt="Find"/></td>
    <td width="30%">   </td>
    </tr>
    <jsp:useBean id="selectEngForm" scope="session" class="Time.SelectEngForm" />
    <% if (selectEngForm.getEngSearchNumber() != null) { %>
    <tr>
    <td width="30%"></td>
    <td width="40%" align="center"><select name="engListing" size="5">
    <%= selectEngForm.getEngListing() %>
    </select></td>
    <td width="30%">   </td>
    </tr>
    <% } else if (selectEngForm.getClientSearchName()!=null){ %>
    <tr>
    <td width="30%"></td>
    <td width="40%" align="center"><select name="engListing" size="5">
    <%= selectEngForm.getEngListing()%>
    </select></td>
    <td width="30%">   </td>
    </tr>
    <% } %>
    <%=request.getParameter("engListing")%>
    </table>
    <br><br>
    <table border="0" width="100%">
    <tr>
    <td width="30%"></td>
    <td width="11%" align="center"> <html:image property="addButton" src="images/Add.gif" alt="Add the selected engagement to the timesheet"/> </td>
    <td width="11%" align="center"> <html:image property="cancelButton" src="images/Cancel.gif" alt="Cancel"/> </td>
    <td width="30%">   </td>
    </tr>
    </table>
    </html:form>
    </center>
    <br>
    <center><html:link forward="timesheet"> <html:img src="images/Back.gif" border="0"/> </html:link></center>
    </body>
    </html:html>

Maybe you are looking for