Servlets accessing beans
Hi,
I know I can use
<jsp:useBean>to create and access named Bean objects in my application from JSP. But I would like to create a named Bean object from a servlet and store it in the session scope, so that my JSPs can access this later.
How do I instantiate a named bean in a servlet?
Thanks!
MyBean myBean = new MyBean();
session.setAttribute("myBean", myBean);
Now you can access the bean in a JSP using:
<jsp:useBean id="myBean" scope="session" class="MyBean" />
Similar Messages
-
Can servlet access Serializable Bean ?
This is my bean below.. My jsp pages can access this bean but my servlet cannot... Do I need to make remove the Serializable interface that I am implementing right now so servlet can access ? Can serlvet access beans ?
import java.io.*;
import java.sql.*;
import javax.sql.*;
import java.util.*;
* Re-usable database connection class
public class ConnectDB implements Serializable{
// setup connection values to the database
static final String DB_DRIVER = "";
static final String myURL = "";
static final String USERNAME = "";
static final String PASSWORD = "";
static Connection con = null;
public ConnectDB(){}
/* Returns a connection the file that calls the method*/
public static Connection getConnection()
try
Class.forName("oracle.jdbc.driver.OracleDriver");
con = DriverManager.getConnection("......");
catch (Exception e)
e.printStackTrace();
finally
return con;
/*Closes Connections*/
public static void closeConnection(Connection con)
try
if (con != null)
con.commit();
con.close();
catch (Exception e)
e.printStackTrace();
}A Servlet is just a Java class and so can access beans. Also, a JSP is translated to a servlet before execution so you already have a servlet accessing the bean.
Can you post relevant code and error message? -
Can I run the Servlet and Bean code on Sun ONE Webserver 6.1 SP5
Hi all.
My environment as below.
1) Windows 2000 Server SP4
2) Sun ONE Webserver 6.1 SP5
3) JRE1.5.0
The directory ( WEB-INF/classes) where is to create on. I have a Bean and Servlet code but I can't
to run it on. Another code Jsp, HTML can run.
How can I do?Your question is somewhat vague, but I'll presume that you are asking how you can invoke your servlets.
If the servlet classes are correctly deployed, you can invoke them directly. i.e. http://host/<app>/servlet/<classname>. Or, you can create servlet mappings.
Java beans cannot be invoked the same way a servlet can. You can access beans from within servlets.
For more details, check out the servlet tutorials at http://java.sun.com -
Portal runtime error: Cannot access bean property
Dear all,
Does anybody have a clue what problem might couse the <b>Portal Runtime Error</b> described below?
It does seem to occur when a second user wants to access the <b>Component</b>.
<b>Portal Runtime Error</b>
An exception occurred while processing a request for :
iView : pcd:portal_content/com.xxxxx.luminaires/com.xxxx.iviews/Quotations/EasyQuote
<b>Component</b> Name : EasyQuoteDemo.EasyQuoteComponent
Tag tableView attribute model: Cannot access bean property quotationHeader.CurrentTableModel in page context.
Exception id: 04:50_21/09/04_0070
See the details for the exception ID in the log file
Thxs in advance
JoostHi Dominik,
Having a closer look at the problem, we found it is not the number of users.
It seems our JAVA components keeps the conenctions with SAP open and reopens a new one every time we start the component.
If we finished solving the problem, I will publish the solution.
Greetings,
Joost -
Hi frnds i want to help in servlet,java bean and JSP
hi friends i'm right now in M.SC(IT) and i want to do project in SERVLET,,JAVA BEANS and JSP ,
so pls give me a title about that
NOTE: I develop a project in group(2 persons there)
my email id is : [email protected] , [email protected] , [email protected]You cannot pair your iPod to a cell phone, so forget about it.
The only way you can get free WiFi is to hang out at a Denny's, a Starbucks, or a truck stop, and I don't think your parents would approve.... -
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.
... -
Help:accessing beans method
hello
i have made one application in which i have made two beans under different packages. i am trying to access beans through jsp pages. i am able to access beans and their methods but when i add new method in bean and tried to access that method with different new jsp page say page1.jsp. I am not able to access new method though i am able to access old methods of same beans with this new jsp page. then i made new bean and copied that method in this new bean . then i tried to access that method of this new bean with page1.jsp and i am able to access it can any body guide me what is the reason for this. i want to run this method in old beran rather than new bean
my directory structure is:
projectlms---main folder
addstream---old jsp page
page1---new jsp page
web-inf/classes
com-------main packageof beans
ProgramManager----sub package of classes
bean1--------old bean
new bean------new bean just for testing
now the problem is that i want to add one more method to bean1 and want to access it through pag1.jsp
but i am not able to access it and same method when i take to new bean i am able to access that method through page1.jsp
but i am able to access old methods of bean1 through page1.jsp
thanks
regards
vivekCould be a caching issue.
Wipe out the COMPILED jsps and try again. -
Access bean(wrapper) for EJB
How can I develop access bean(wrapper) for EJB in JDeveloper?
Search the Internet for a product called JACOB
JAva COm Bridge -
Server Shows : Error in Accessing Beans
here it shows the error as "Error in Accessing Beans".Anybody knows solutions pls give solutions for this.
Hi Visakh,
Yes,The user is holding the permission as "Global User" in sql.Hope you help me in solve this issue
Thanks, Quality Communication Provides Quality Work. http://siddiq-sharepoint2010.blogspot.in/ Siddiqali Mohammad .
Hi siddiqali,
According to the screenshot you posted above, the use account didn't have sufficient permission to open the report, please check the following prerequisites before you perform the action:
You must use a report definition (.rdl) file as a data source. Importing from a report model is not supported.
You must have permission to open the report under your Windows user account, and you must know the address of the report or the report server that hosts it. You can check your permissions by trying to open the report in a Web browser first.
If the report opens, it confirms that you have sufficient permissions and the correct URL.
Reporting Services must be version SQL Server 2008 R2 or SQL Server 2012. Those versions include the data feed export feature that streams report data in the XML data feed format. You can identify the report server by the Export as Data Feed option
that appears in the report toolbar when you open the report in browser:
For detail information, please see:
Import Data from a Reporting Services Report:
http://technet.microsoft.com/en-us/library/gg413491.aspx
Regards,
Elvis Long
TechNet Community Support -
hi to all,
i created a simple bean for login access that has getter and setter method...
I am trying to access the bean in a servlet .. i got error....
my bean code is ...
simple login page
<form method="post" action="/BeanServlet">
user Name :
<input type="input" name="username" >
Password :
<input type="password" name="password" >
<input type="submit" value="submit" >
</form>
package use;
public class UserData {
String username;
String password;
public void setUsername( String value )
username = value;
public void setPassword( String value )
password = value;
public String getUsername() { return username; }
public String getPassword() { return password; }
please fill in the Servlet code is
response.setContentType("text/html");
PrintWriter out = response.getWriter();
HttpSession session = request.getSession();
UseData ud = (UserData) session.getAttribute();
????? what comes here
out.println(ud.getPassword(););
out.println(ud.getUsername());sorry kannankalli, but this is what i understood from your question, that you want to take the information of a form from a servlet,,
and this is the servlet code:
import java.io.IOException;
import java.io.PrintWriter;
import javax.servlet.*;
import javax.servlet.http.*;
public class Servlet extends HttpServlet {
private static final String CONTENT_TYPE = "text/html; charset=windows-1252";
public void init(ServletConfig config) throws ServletException {
super.init(config);
public void doPost(HttpServletRequest request,
HttpServletResponse response) throws ServletException,IOException {
String retrievedUserName = request.getParameter("userNameField");
String retrievedPassword = request.getParameter("passwordField");
response.setContentType(CONTENT_TYPE);
PrintWriter out = response.getWriter();
out.println("<html>");
out.println("<head><title>Servlet</title></head>");
out.println("<body>");
out.println("<p>The userName is: </p>" + retrievedUserName);
out.println("<p>The password is: </p>" + retrievedPassword);
out.println("</body></html>");
out.close();
notice request.getParameter("userNameField"); the userNameField is the same name as the textField in the html page, and so the password...
I hope i reached your point..(^_^); -
Hi all,
I am having some problems accessing JavaBeans from my servlets, but I can access them from my JSP page(i used the import command, <%@ page import="servlets.myBeans.login.User" %>, and it works).
I have placed my User bean in the following package
\webapps\ROOT\WEB-INF\classes\servlets\myBeans\login
Here's the java code for User Bean
package servlets.myBeans.login;
* A simple Java Bean for users.
public class User implements java.io.Serializable{
private String username = null;
private String password = null;
public User() {}
public User (String u, String p) {
username = u;
password = p;
public String getUsername() {
return username;
public void setUsername(String username) {
this.username = username;
public String getPassword() {
return password;
public void setPassword(String password) {
this.password = password;
public String toString() {
return username + ":" + password;
This compiles and creates a class file.
My servlet LoginControlServlet is in the following path
\webapps\ROOT\WEB-INF\classes\servlets
when I try to compile this servlet i get the following errors
C:\jakarta-tomcat-4.1.1.12-LE\jakarta-tomcat-4.1.24-LE-jdk14\webapps\ROOT\
WEB-INF\classes\servlets\LoginControlServlet.java:18:
cannot resolve symbol
symbol : class User
location: class servlets.LoginControlServlet
User up = (User)session.getAttribute("up");
^
C:\jakarta-tomcat-4.1.1.12-LE\jakarta-tomcat-4.1.24-LE-jdk1\webapps\ROOT
\WEB-INF\classes\servlets\LoginControlServlet.java:18:
cannot resolve symbol
symbol : class User
location: class servlets.LoginControlServlet
User up = (User)session.getAttribute("up");
^
C:\jakarta-tomcat-4.1.1.12-LE\jakarta-tomcat-4.1.24-LE-jdk1\webapps\ROOT
\WEB-INF\classes\servlets\LoginControlServlet.java:27:
cannot resolve symbol
symbol : class User
location: class servlets.LoginControlServlet
up = new User(user,pass);
^
3 errors
I have already included the \webapps\ROOT\WEB-INF\classes in my class path
infact, I have even included \webapps\ROOT\WEB-INF\classes\servlets and
\webapps\ROOT\WEB-INF\classes\servlets\myBeans\login in my classpath.
Any ideas, as to why I am having the above errors.
thanks,
manishI think it's pretty much got to be a compile time classpath problem. Either your bean is compiling to a funny place, or you classpath is wrong when you compile the servlet. Probably the latter if your jsp picks it up OK.
The entry in the classpath should be
<tomcat directory>/webapps/ROOT/WEB-INF/classes
Check the syntax carefully.
putting package directories on your classpath can only confuse things.
Make sure that ...../webapps/servlets/myBeans/login/User.class exists. -
Running netscape servlet access a weblogic deployed bean
I an having problems creating the initialcontext object when tring to access a
bean deployed in
Weblogic6.0 from a servlet running in netscape Iplanet server. Has anyone every
got this to work?
Is this a valid configuration or does the servlet have to be running in the weblogic
server.
Thanks DougI an having problems creating the initialcontext object when tring to access a
bean deployed in
Weblogic6.0 from a servlet running in netscape Iplanet server. Has anyone every
got this to work?
Is this a valid configuration or does the servlet have to be running in the weblogic
server.
Thanks Doug -
Error while accessing bean created from servlet
Hi there
I have a jsp page form home.jsp where i am collecting user name and password and then directing to a LoginServlet.Here if the user is validated then i create a accMasterBean and store it in Session object which i create here and then redirect to profile.jsp
In the profile.jsp page i am using bean as follows:--
<jsp:useBean id="accMasterBean" scope="session" class="AccountMaster">
<jsp:setProperty name="accMasterBean" property="*"/>
</jsp:useBean>
i am fetching the properties of this bean in profile.jsp itself and try to display as shown below:---
<%=accMasterBean.getAccountNumber() %>
where accountNumber is a property defined inside AccountMaster class
but it gives an error as follows :---
<input type="text" name="emailAddress" value="Exception generated ---javax.servlet.ServletException: Exception thrown on line '205' from page 'D:\\Program Files\\Allaire\\JRun\\servers\\default\\emtech2\\jsp\\members\\profile.jsp'.
Plz note if remove the above line of fetching the property of bean in profile.jsp page then there is no error
Hoping to get a reply soon
Thanking u
Mumtaz
The code for LoginServelt is given below
====================================
import javax.servlet.*;
import javax.servlet.http.*;
import java.io.*;
import java.sql.*;
public class LoginServlet extends HttpServlet{
private Connection conn=null;
public void init(ServletConfig config)throws ServletException{
super.init(config);
public void doPost(HttpServletRequest request,HttpServletResponse response)throws ServletException,IOException{
try{
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
conn=DriverManager.getConnection("jdbc:odbc:emt");
}catch(ClassNotFoundException e){System.out.println("Error loading database driver");}
catch(SQLException e){ System.out.println("SQL Exception in Databse driver"); }
PrintWriter out = null;
out=response.getWriter();
response.setContentType("text/html");
Statement st=null;
ResultSet rs=null;
String aN=null;
String pN=null;
String accountNumber1=null;
String pinNumber1=null;
String alternatePassword1=null;
String emailAddress1=null;
String firstName1=null;
String lastName1=null;
String address1=null;
String zipPostalCode1=null;
String city1=null;
String state1=null;
String country1=null;
String companyName1=null;
String title1=null;
String homePhone1=null;
String workPhone1=null;
String mobilePhone1=null;
String pager1=null;
String faxNo1=null;
String website1=null;
//Date dob;
String dateOfBirth1=null;
String gender1=null;
String securityStatus1=null;
//Date doreg;
String dateOfRegistration1=null;
int noOfAccounts1=0;
int noOfAttempts1=0;
String remarks1=null;
try{
aN=request.getParameter("accountNumber");
pN=request.getParameter("pinNumber");
st=conn.createStatement(); // creating a statement to execute
rs=st.executeQuery("SELECT * FROM ACCOUNT_MASTER where AccountNumber=\'" + aN + "\' and PinNumber= \'"+pN +"\' ;");
while (rs.next())
accountNumber1=rs.getString("AccountNumber");
pinNumber1=rs.getString("PinNumber");
//alternatePassword1=rs.getString("alternatePassword");
emailAddress1=rs.getString("EmailAddress");
firstName1=rs.getString("FirstName");
lastName1=rs.getString("LastName");
address1=rs.getString("Address");
zipPostalCode1=rs.getString("ZipPostalCode");
city1=rs.getString("City");
state1=rs.getString("State");
country1=rs.getString("Country");
companyName1=rs.getString("CompanyName");
title1=rs.getString("Title");
homePhone1=rs.getString("HomePhone");
workPhone1=rs.getString("WorkPhone");
mobilePhone1=rs.getString("MobilePhone");
pager1=rs.getString("Pager");
faxNo1=rs.getString("FaxNo");
website1=rs.getString("WebSite");
gender1=rs.getString("Gender");
break ;
// closing the connection
rs=null;
st=null;
conn.close();
if((accountNumber1.equals(aN))&&(pinNumber1.equals(pN))){
// create all beans address and userprofile
HttpSession session=request.getSession();// creating the session
AccountMaster accMasterBean=new AccountMaster();
accMasterBean.setAccountNumber(accountNumber1);
accMasterBean.setPinNumber(pinNumber1);
accMasterBean.setEmailAddress(emailAddress1);
accMasterBean.setFirstName(firstName1);
accMasterBean.setLastName(lastName1);
accMasterBean.setAddress(address1);
accMasterBean.setZipPostalCode(zipPostalCode1);
accMasterBean.setCity(city1);
accMasterBean.setState(state1);
accMasterBean.setCountry(country1);
accMasterBean.setCompanyName(companyName1);
accMasterBean.setTitle(title1);
accMasterBean.setHomePhone(homePhone1);
accMasterBean.setMobilePhone(mobilePhone1);
accMasterBean.setWorkPhone(workPhone1);
accMasterBean.setPager(pager1);
accMasterBean.setFaxNo(faxNo1);
accMasterBean.setWebsite(website1);
accMasterBean.setGender(gender1);
session.setAttribute("accMasterBean",accMasterBean);// setting the account bean in the session attribute
getServletConfig().getServletContext().getRequestDispatcher("/jsp/members/profile.jsp").forward(request,response);
}else{
// do some processing for account field and pasword field not set and return back to main page
getServletConfig().getServletContext().getRequestDispatcher("/jsp/signup.jsp").forward(request,response);
}// end of try
catch(SQLException e){out.println("SQL Exception generated in LoginServlet---"+e);}
catch(Exception e1){ out.println("Exception generated in LoginServlet---" + e1);}
finally{
try{
if(conn!=null) conn=null;
if (rs!=null) rs=null;
if(st!=null) st=null;
}catch(Exception e){out.println("Exception closing database connections "+e);}
} // end of doPost
public void destroy(){
try {
if(conn!=null) conn=null;
catch (Exception e) { System.out.println("Error closing database connection"); }
public void doGet(HttpServletRequest request,HttpServletResponse response)throws ServletException,IOException{ doPost( request, response);}
}//end of loginservlet
=======================================Hi everyone
I have got the solution
Thanks
Mumtaz -
Accessing bean properties in a jsp
Hi,
I am trying to access a bean in my jsp page like this,
<c:out value="${clientSession.customerName}"/>
I validate and then set the bean in my action class, I am using struts 1.1,
package com.neo.five.ereports;
import org.apache.struts.action.Action;
import org.apache.struts.action.ActionForward;
import org.apache.struts.action.ActionMapping;
import org.apache.struts.action.ActionForm;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.Cookie;
import javax.servlet.http.HttpSession;
import com.neo.five.cookies.SessionCookieValidator;
import com.neo.five.beans.CustomerSessionBean;
public final class EreportAction extends Action{
public ActionForward execute(ActionMapping mapping,
ActionForm form,
HttpServletRequest request,
HttpServletResponse response){
//get the session object
HttpSession session = request.getSession(false);
//validate the session cookie if session object dows not exist
Cookie[] cookies = request.getCookies();
SessionCookieValidator scv = new SessionCookieValidator(cookies);
scv.checkCookie();
//forward to appropriate destination
//if there is a cookie continue
if(scv.hasSessionCookie()){
//check for session object
if (session != null) {
//if session does not exist put bean into session that holds the cookie
//values
if(session.getAttribute("cookieSession")==null){
CustomerSessionBean sb = new CustomerSessionBean(scv.getCustomerid(),scv.getCustomerName(),scv.getCfid(),scv.getCftoken());
session.setAttribute("cookieSession", sb);
request.setAttribute("clientSession",sb);
return (mapping.findForward("success"));
}else{
return (mapping.findForward("failure"));
}else{
return (mapping.findForward("failure"));
}this is my SessionBean
package com.neo.five.beans;
public class CustomerSessionBean {
private int customerid;
private String customerName;
private int cfid;
private int cftoken;
public CustomerSessionBean(int customerid,String customerName,int cfid,int cftoken){
this.customerid=customerid;
this.customerName=customerName;
this.cfid=cfid;
this.cftoken=cftoken;
public int getCustomerid(){
return customerid;
private String getCustomerName(){
return customerName;
private int getCfid(){
return cfid;
private int getCftoken(){
return cftoken;
}however I am getting this error,
HTTP Status 500 -
type Exception report
message
description The server encountered an internal error () that prevented it from fulfilling this request.
exception
org.apache.jasper.JasperException: An error occurred while evaluating custom action attribute "value" with value "${clientSession.customerName}": Unable to find a value for "customerName" in object of class "com.neo.five.beans.CustomerSessionBean" using operator "." (null)
at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:254)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:295)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:241)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:684)
at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:432)
at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:356)
at org.apache.struts.action.RequestProcessor.doForward(RequestProcessor.java:1069)
at org.apache.struts.action.RequestProcessor.processForwardConfig(RequestProcessor.java:455)
at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:279)
at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1482)
at org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:507)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:247)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:193)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:256)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
at org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2422)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:180)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
at org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.java:171)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:163)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:174)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
at org.apache.coyote.tomcat4.CoyoteAdapter.service(CoyoteAdapter.java:199)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:828)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:700)
at org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:584)
at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:683)
at java.lang.Thread.run(Thread.java:536)
root cause
javax.servlet.ServletException: An error occurred while evaluating custom action attribute "value" with value "${clientSession.customerName}": Unable to find a value for "customerName" in object of class "com.neo.five.beans.CustomerSessionBean" using operator "." (null)
at org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:533)
at org.apache.jsp.eReportDeskTopRoot_jsp._jspService(eReportDeskTopRoot_jsp.java:145)
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:137)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:210)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:295)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:241)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:684)
at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:432)
at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:356)
at org.apache.struts.action.RequestProcessor.doForward(RequestProcessor.java:1069)
at org.apache.struts.action.RequestProcessor.processForwardConfig(RequestProcessor.java:455)
at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:279)
at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1482)
at org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:507)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:247)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:193)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:256)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
at org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2422)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:180)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
at org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.java:171)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:163)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:174)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
at org.apache.coyote.tomcat4.CoyoteAdapter.service(CoyoteAdapter.java:199)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:828)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:700)
at org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:584)
at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:683)
at java.lang.Thread.run(Thread.java:536)
Apache Tomcat/4.1.30
thanks for any help.how?.... mmmm ... did ... (head scratch) ...I miss that.
Thanks a million for spotting that, I really did appreciate that.
jp. -
Accessing bean attributes in a JSP
Hi,
I am sending a bean from a Servlet to a JSP as follows:
request.setAttribute("newclientTEST", ro_client);
this.getServletContext().getRequestDispatcher("/jsp/private/research/UserAdded.jsp").forward(request,
response);I can then access the bean in UserAdded.jsp page as follows:
<jsp:getProperty name="newclientTEST" property="username" />This works fine and returns the username from the bean but I am a little confused why this is working. From what i have read about JSPs so far in order to access properties of a bean in a JSP we first of all have to make a reference to the bean as follows:
<jsp:useBean id="newclientTEST" scope="request" class="ie.scourced.beans.PrivateClientBean" />Why does it work for me when I don't refer to the bean using useBean??
Thankshow?.... mmmm ... did ... (head scratch) ...I miss that.
Thanks a million for spotting that, I really did appreciate that.
jp.
Maybe you are looking for
-
How do i transfer an ibook from desktop to macbook pro
I have a second hand mac book pro and need to transfer my ibook files from a desktop to the laptop. How do I do it?
-
How can I add a third line of text to a title?
I am making a music video for my highschool students to teach about recycling and I want to add a title to the bottom with the song title, the name of the ficticious band and the ficticious record label. I have tried to add the third line of text, bu
-
Selective member import/export using dllexport and default constructor
We can only export some methods in the class(https://msdn.microsoft.com/es-es/library/8d7d1303-b9e9-47ca-96cc-67bf444a08a9%28v=vs.100%29) What if we export only some methods in the class and not exported the default constructor(Will it get generated
-
Cannot fill in a fillable form, AR 9.3.3, Mac OS 10.6.2
Using a Mac with 10.6.2, just updated to Reader 9.3.3. I have downloaded a PDF that is supposed to have filable form fields. The forms properties say the Filling of Form fields is allowed. I can get my cursor to blink in each field but cannot get tex
-
Does anyone know if I re-install my system if it will delete all hidden files? or re-write over them?