Bean create & use

Hi All,
I have problem with a jsp page which use a bean! Perhaps I get wrong when I compile the bean file "Login.java" or I place "Login.class" in wrong place! Can you tell me where I must place compiled file in TOMCAT folder?
The error displayed is:
C:\jakarta-tomcat-4.1.30\work\Standalone\localhost\examples\jsp\prove\process_jsp.java:43: cannot resolve symbol
symbol : class Login
location: class org.apache.jsp.process_jsp
Login idHandler = null;
^
An error occurred at line: 1 in the jsp file: /jsp/prove/process.jsp
Generated servlet error:
C:\jakarta-tomcat-4.1.30\work\Standalone\localhost\examples\jsp\prove\process_jsp.java:45: cannot resolve symbol
symbol : class Login
location: class org.apache.jsp.process_jsp
idHandler = (Login) pageContext.getAttribute("idHandler", PageContext.REQUEST_SCOPE);
^
An error occurred at line: 1 in the jsp file: /jsp/prove/process.jsp
Generated servlet error:
C:\jakarta-tomcat-4.1.30\work\Standalone\localhost\examples\jsp\prove\process_jsp.java:48: cannot resolve symbol
symbol : class Login
location: class org.apache.jsp.process_jsp
idHandler = (Login) java.beans.Beans.instantiate(this.getClass().getClassLoader(), "Login");
^
3 errors
This is process.jsp pagecode:
<%@ page import="java.util.*" %>
<jsp:useBean id="idHandler" class="Login" scope="request">
<jsp:setProperty name="idHandler" property="*"/>
</jsp:useBean>
<%
if (idHandler.validate()){
%>
<jsp:forward page="success.jsp"/>
<%
} else
%>
<jsp:forward page="retry.jsp"/>
<%
%>
...and this Login.java file code
import java.sql.*;
public class Login {
private String username = "";
private String password = "";
public Login()
public void setUsername(String username)
     this.username = username;
public void setPassword(String password)
     this.password = password;
public boolean authenticate(String username2,String password2)
     String query="select * from people;";//Registration;";
     String DbUserName="";
     String DbPassword="";
     String finalUser="";
     try {
          Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
          Connection con=DriverManager.getConnection("jdbc:odbc:register");
          Statement stat=con.createStatement();
          ResultSet rst=stat.executeQuery(query);
          while(rst.next())
               DbUserName=rst.getString("UserName");
               DbPassword=rst.getString("Password");
               if (username2.equals(DbUserName) && password2.equals(DbPassword))
                    break;
          return true;
     }catch(Exception e)
          e.printStackTrace();
          return false;
Can you help me???
Thank's

hai
beans are generally placed in package specific folders.
copy the classfiles into classes directory of tomact
tomcat/webapps/ROOT/WEB-INF/classes/<packagename>/*.class
in jsp class="<packagename>.Login" try this it will work

Similar Messages

  • Do some processing before loading jsf fragment created using adf task flow

    Hi,
    I am working on JDev11g.
    I want to create SelectItems of SelectOneChoice dynamically before loading jsf fragment created using adf task flow
    I tried by implementing RegionController class's method RefreshRegion in my backing bean of jsf page fragement to do some processing before loading region
    But it seems to be not feasible approach because it is getting called every time any component on fragement gets partially submitted.
    Is there any method which is called only first time when region is loaded ?
    Or any other solution to achieve this.
    Regards,
    Devang

    Hi,
    don't think so. You would need a phase listener, but I don't see how you get it in. Wha about using a dynamic region and then use the method that is called from the dynamic region first time it is rendered?
    Frank

  • Question about 'Beans in Use' statistic in weblogic console

    I am trying to figure out why the weblogic server is taking up so much
    memory in our system.
    We are running weblogic 6.1sp3 on solaris 2.7 and are quickly running
    out of memory.
    I run a 5 user test for an hour that results in around 240 'budgets'
    being created via a Budget entity bean.
    At the start of the run, the java weblogic process takes up 157meg.
    At the end of the run(actually many hours after the run has stopped
    and there has been no other activity), it is at to 696 meg
    The weblogic console tells me the following information on my Budget
    entity bean at the end:
    Idle: 0
    Beans in use: 246
    Cached: 50
    Passivated: 191
    My question is this, is 246 'Beans in use' a sign that I am not
    releasing resources correctly? what does it mean to have 246 'Beans
    in use'? the help on that screen says that 'beans in use' is the
    number of beans in use, active or ready state. I understand that an
    'active' bean is one that has a PK assigned and has been moved from
    'pooled' to 'ready'. passivated bean does not have PK associated and
    moved from 'ready' to 'pooled'. I can't figure out why it has 246
    beans ready or active? If someone could better explain what 'beans in
    use' means I'd greatly appreciate it. I put print outs in
    active/passivate/unsetEntityContext and I see active/passivate get
    called but no unsetEntityContext. It also seems that it doesn't reuse
    the 'container'. After a passivate, I'd expect the next 'activate' to
    re-use that seem bean that was just passivated, but it does not seem
    to.
    I feel like I'm missing the boat here on something. I understand
    'cached' beans and how to control that number. Where I feel I need
    some help is understanding what happens to the bean once it is
    'passivated'. Why aren't those being reused? why don't they have
    some 'max' that will cause them to be removed? (does
    max-beans-in-free-pool work for entity beans in 6.1??)
    any feedback would be greatly appreciated!
    thanks
    Kelly

    Hi Kelly,
    Semantics of ejbPassivate/ejbActivate methods of Entity
    beans is quite different from SFSB.
    For Entity Bean ejbPassivate is called when a bean loses its
    identity and transitions from Ready to Pooled state. ejbActivate
    is called when a bean transitions from Pooled to Ready state.
    Hope this helps,.
    Regards,
    Slava Imeshev
    "Kelly Kingdon" <[email protected]> wrote in message
    news:[email protected]...
    I am trying to figure out why the weblogic server is taking up so much
    memory in our system.
    We are running weblogic 6.1sp3 on solaris 2.7 and are quickly running
    out of memory.
    I run a 5 user test for an hour that results in around 240 'budgets'
    being created via a Budget entity bean.
    At the start of the run, the java weblogic process takes up 157meg.
    At the end of the run(actually many hours after the run has stopped
    and there has been no other activity), it is at to 696 meg
    The weblogic console tells me the following information on my Budget
    entity bean at the end:
    Idle: 0
    Beans in use: 246
    Cached: 50
    Passivated: 191
    My question is this, is 246 'Beans in use' a sign that I am not
    releasing resources correctly? what does it mean to have 246 'Beans
    in use'? the help on that screen says that 'beans in use' is the
    number of beans in use, active or ready state. I understand that an
    'active' bean is one that has a PK assigned and has been moved from
    'pooled' to 'ready'. passivated bean does not have PK associated and
    moved from 'ready' to 'pooled'. I can't figure out why it has 246
    beans ready or active? If someone could better explain what 'beans in
    use' means I'd greatly appreciate it. I put print outs in
    active/passivate/unsetEntityContext and I see active/passivate get
    called but no unsetEntityContext. It also seems that it doesn't reuse
    the 'container'. After a passivate, I'd expect the next 'activate' to
    re-use that seem bean that was just passivated, but it does not seem
    to.
    I feel like I'm missing the boat here on something. I understand
    'cached' beans and how to control that number. Where I feel I need
    some help is understanding what happens to the bean once it is
    'passivated'. Why aren't those being reused? why don't they have
    some 'max' that will cause them to be removed? (does
    max-beans-in-free-pool work for entity beans in 6.1??)
    any feedback would be greatly appreciated!
    thanks
    Kelly

  • How can I Publish to a Folder just one of the several websites I have created using iWeb?

    How can I Publish to a Folder just one of the several websites I have created using iWeb?
    it drives me nuts having to emove all the other websites when I want to upload one. 
    Sparrow

    For iWeb, I like to do only one site per domain file.  I move domain files out of the Application Support folder and place them inside project or client folders, or in DropBox. Once you duplicate a domain file and begin customizing it, it will load and behave as a separate project/site.
    I publish each iWeb domain/project direct to a server via FTP. Sometime I publish to a folder, then upload via FTP manually.
    iWeb is a remarkable tool, especially when you work from scratch with blank tamplates
    Here are a few of my iWeb sites:
    http://www.newcovenant.org
    http://www.visionmultimedia.org
    http://www.visioncomsolutions.com

  • Unable to install Adobe CS5 64 bit package created using Adobe Application Manager on Windows 7 64

    I am unable to install Adobe CS5 64 bit package created using Adobe Application Manager on Windows 7 64 bit.Basically installation rollback on Win 7 64 bit image.
    MSI Log File :-
    Property(S): ProductToBeRegistered = 1
    MSI (s) (5C:D4) [17:59:21:784]: Note: 1: 1708
    MSI (s) (5C:D4) [17:59:21:784]: Product: Adobe_CreativieSuite_5_MNT -- Installation operation failed.
    MSI (s) (5C:D4) [17:59:21:784]: Windows Installer installed the product. Product Name: Adobe_CreativieSuite_5_MNT. Product Version: 1.2.0000. Product Language: 1033. Manufacturer: Adobe Systems Incorporated. Installation success or error status: 1603.
    Please let me how to install 64 bit package on Win7 64 bit.
    Thanks in Advance.

    Ok so I downloaded the most current installer CS5.1, My previous installer was version 5.0. It did install fine fully updated to my license version. I just wanted to update in case anyone in the future has a similiar experience. Too bad this advice was not offered by the "experts" here.

  • Importing modified Bug WIT does not refresh the template in TFS 2013 for the project created using Scrum Template.

    Hi,
    We have a TeamProjectA created in a collection using ScrumTemplate 2013.4. I have added a new State 'Duplicate' in the Bug WIT and modified the workflow. Also the ProcessConfiguration file is modified to match the metastate and imported using the ImportWit
    Commands which were successful. When I Export the modified WIT using Process Editor for TeamProjectA I can see the Bug.xml has my changes. However, when I try to create a new Bug through TWA, I do not see the new State'Duplicate' that I added.
    I dont see my changes are updated in the common configuration files Path ie C:\\Program Files\Microsoft Team Foundation Server 12.0\Tools\Deploy\ProcessTemplateManagerFiles
    Note: I have a different TeamProjectB created using the Agile template created under the same Collection as my other TeamProjectA. Not sure if this has anything to do with my problem.

    Hi NetLearuner15,  
    Thanks for your reply.
    If you want use witadmin command on your TFS Server machine, you need install VS 2013 on your TFS 2013 Server machine.
    Have you tried create new Bug using VS? The new added state value shows correctly in VS or cannot see it in VS too?
    You’re using TFS 2013 Update 4 and VS 2013 Update 4?
    Yes, you can restart your TFS Server and check the result.
    And we suggest you add a new custom field in your Bug_Test work item type(Fields and Layout) or only edit a default state value in it using Process Editor, then save this Bug_Test work item type and check if this new update shows correctly when you create
    a new Bug_Test work item from TFS Server. If the  new field or changed state value can be updated correctly in your TFS Server, I think your initial ‘Duplicate’ state value not defined correctly in your Bug WIT>>workflow.
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • Can't open 1 document created using travel journal template

    Since installing Snow Leopard yesterday I found out I can't open this one file I created using the travel journal template. All other Pages '09 files are fine. I just get this error message telling me Pages had to close my document "unexpectedly".
    *"Pages quit unexpectedly while using the SFWordProcessing plug-in"*
    Don't see why it would need to use this plug-in. And I don't recall choosing this plug-in. There must be a way around this. To open this file by turning off that plug-in perhaps. Unless it's absolutely necessary when using the templates. Or the "travel journal" template.

    http://discussions.apple.com/thread.jspa?threadID=2141021&tstart=15

  • After installing an application that was created using the Application Builder

    After installing an application that I created using the Application Builder I get this error if I try to run " ANY " LabVIEW App's that I have built. "Executable Version 7.1.1 doesn't match Resource File 7.1. Check your configuration."
    The way that I tried to fix this is to reload LabVIEW 7.1 and DAQmx 8.0. I am using two NI-6528 switch cards.
    After I reload LabVIEW and DAQmx I can run my applications but as soon as I install one on this development machine the error begins again.
    The executable that I built works fine on the development machine and any other machine that I try it on but it appears that the Run-Time engine 7.1 becomes corrupt after I run setup.exe for the newly created application.
    I have built numerous Installers, setup.exe's in the past without this error. Just this latest one caused this problem to start.
    I can NOT upgrade to 7.1.1. I am doing work for many different sections of this factory and I can not force them to upgrade. I've asked. Others supply code for the same machines using LabVIEW 7.1.
    I am stuck creating executables and manualing moving the correct files to the target machines.
    What can be done?

    No. The KB article was talking about a machine with 7.1.1 installed. I have LabVIEW 7.1 installed.
    The machine that I am having trouble with is my development machine. LabVIEW 7.1, DAQmx 8.0.
    If I build the executable all is fine. I can still run old executables including the one I just built.
    If I create the installer all is fine. I can still run old executables including the one I just built.
    When I install the app on my development machine the corruption occurs. I can " NOT " run old executables including the one I just built. The subject error pops up.
    I have not moved any executables to the other machines yet. I don't want to corrupt others.

  • PO could not be creating using the Enjoy-BAPI

    Hi expersts.
    I have a problem with BAPI function module BAPI_PO_CREATE1. When program will generate orders for several suppliers for one supplier "PO could not be creating using the Enjoy-BAPI" and "Purchase order item 00010 still contains faulty schedule lines" and
    "Source not included in list despite source list requirement"  messages occur. Order won't be generated.
    When I am generating order only for that supplier, everything is fine. They are generated and no messages are displayed.
    Could anyone help me ?
    Thanks, regards.
    Dan.

    Hi expersts.
    I have a problem with BAPI function module BAPI_PO_CREATE1. When program will generate orders for several suppliers for one supplier "PO could not be creating using the Enjoy-BAPI" and "Purchase order item 00010 still contains faulty schedule lines" and
    "Source not included in list despite source list requirement"  messages occur. Order won't be generated.
    When I am generating order only for that supplier, everything is fine. They are generated and no messages are displayed.
    Could anyone help me ?
    Thanks, regards.
    Dan.

  • After upgrading to mountain lion, the movies I create using iDVD periodically stop then resume abruptly when I play them back on my DVD player. Any ideas on correcting this?

    After upgrading to mountain lion, the movies/slideshows I create using iDVD playback in a jolting start/stop manner. This didn't happen with the prior os - playbacks were flawless. Any ideas, short of uninstalling mountain lion, on how to correct?

    I know this is not much help. IDVD and Mountain Lion are working perfectly for me.  I know many others that use Mountain Lion with iDVD also.
    I think your problem lies elsewhere.

  • How can we remove an unwanted # in sales order texts created using a bapiFM

    Hi,
    i've written the following code which splits the record fetched from apllication server and moves it into a workarea.
    CONSTANTS:c_sep VALUE cl_abap_char_utilities=>horizontal_tab, "for separation
    SPLIT wa_tab1-rec1 AT c_sep INTO wa_inf_itm-inf_vbeln
                                           wa_inf_itm-itm_number
                                           wa_inf_itm-material
                                           wa_inf_itm-req_qty
                                           wa_inf_itm-uom
                                           wa_inf_itm-amount_pr00
                                           wa_inf_itm-amount_pi02
                                           wa_inf_itm-amount_mwst
                                           wa_inf_itm-amount_vprs
                                           wa_inf_itm-currency
                                           wa_inf_itm-text.
    Here c_sep will have a value '#' instead of 'space' in Flatfile from application server.
    The field 'wa_inf_itm-text' though it doesnot contain any value in debugging, when the sales order is created using FM 'BAPI_SALESORDER_CREATE_FROM_DAT2' the item texts are having a # character at the end of the text if it has any text(when checked in va03--sales order item text) or if it doesnot contain any text ,then also # character is seen in texts.
    Thanks & Regards,
    Prasad Reddy.

    hi
    use
    Replace all occurrence of '#' with space from .......
    I think it will solve ur problem.
    Rewards with point if helpful.
    Regards
    Santosh.

  • How to process each records in the derived table which i created using cte table using sql server

    I want to process each row from the CTE table I created, how can I traverse from first row to second row and so on....
    how to process each records in the derived table which i created using  cte table using sql server

    Ideally you would be doing a set based processing rather than traversing row by row as thats more efficient. To answer it specific to your scenario we may need more info. Can you explain with some sample data your exact requirement?
    Please Mark This As Answer if it solved your issue
    Please Mark This As Helpful if it helps to solve your issue
    Visakh
    My MSDN Page
    My Personal Blog
    My Facebook Page

  • How can I remove a signature on a PDF file that I created using Preview on iMac computer??

    How can I remove a signature on a PDF file that I created using Preview on iMac computer??  I inadvertently hit the icon on the Preview tool bar with an xS and a line through it.  There is my signature in the middle of the PDF file I was editing.  How do I get rid of it?  Cannot select it.  Cannot find any tools that allow me to delete it.  The Preview documentation tells how to create and apply a signature, but not how to remove it.  I think when a signature is added the doucment becomes locked from any editing.

    Hey needadobehelp10,
    Using Adobe Acrobat/Reader, you can simply change your PDF view settings under "View > Page Display > Single Page View"
    Is this really you wish for?
    Please let me know.
    Regards,
    Anubha

  • Can EJB 3.0 beans be used with tables that do not have a primary key?

    Can a EJB 3.0 persistence bean be used with tables that do not have a primary key defined? I am building a test application based on the HowTo - Building EJB 3.0 Faces App paper posted after Openworld (schalk). The issue I am running into when trying to run the application is: Exception Description: Entity class [class com.persistence.Rpthead] has no primary key specified. Note: I get a simular error when using toplink directly.
    The tables I am binding to do not have primary keys defined. They use unique constraints to manage the table integrity.
    Is it possible to use EJB 3.0 on tables without a primary key? If not, are there plans to support this in the future?

    The spec requires a primary key Id annotation. I will take your suggestion to EJB 3.0 expert group.
    Can you also send an email to [email protected] with your requirement?
    -Debu

  • Invoking a web service not created using oracle web service lib

    Hi All,
    I have a need to invoke my web service from oracle sql command. My web service not created using oracle web service library, but it is created using axis c++ libraries. Is it possible to do so,
    Thanks in advance,
    Regards,
    Monica

    In order to call out from the database process, is SQL (or PL/SQL) you need to generate some client code, that understand the details about the specific of the service you want to invoke and can produce the correct SOAP request. Once this proxy is uploaded in the Database, you can use it.
    There is a set of Database Web services samples that should help you get started. You can also take a look at the developer's guide - see Developing a Web Service Client in the Database.
    Hope it answers your question.
    --eric                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

Maybe you are looking for