MyEclipse Forums
Post new topic   Reply to topic
View previous topic Printable version Log in to check your private messages View next topic
Author Message
eswearg
Post subject: Hibernate Problum[special request to Mr.Kalla  PostPosted: Oct 21, 2004 - 04:05 AM



Joined: Oct 20, 2004
Posts: 4

Dear Mr.Kalla!
Thanq for replying my post.
here iam posting the entire code [as an attachment]of the page

Plz help me to fix the bug
thanking you
eswar

<AddUserData.jsp>

in code page iam replacing <%,%>,<,> with 2 dots[..],
becoz when iam posting the exact page itz not accepting.

Code Follows..



..@ page language="java"..

..@ taglib uri="http://jakarta.apache.org/struts/tags-bean" prefix="bean" ..
..@ taglib uri="http://jakarta.apache.org/struts/tags-html" prefix="html" ..
..@ taglib uri="http://jakarta.apache.org/struts/tags-logic" prefix="logic" ..
..@ taglib uri="http://jakarta.apache.org/struts/tags-tiles" prefix="tiles" ..
..@ taglib uri="http://jakarta.apache.org/struts/tags-template" prefix="template" ..
..@ taglib uri="http://jakarta.apache.org/struts/tags-nested" prefix="nested" ..


..@ page import="com.planters.hibernate.UsersService"..
..@ page import="java.util.List"..


..!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"..
..html:html locale="true"..
..head..
..html:base /..

..title..Users Example../title..

..meta http-equiv="pragma" content="no-cache"..
..meta http-equiv="cache-control" content="no-cache"..
..meta http-equiv="expires" content="0"..
..meta http-equiv="keywords" content="keyword1,keyword2,keyword3"..
..meta http-equiv="description" content="This is my page"..
../head..

..body..

..h3..Users Example../h3..
..html:errors/..

..
// This code will Generate a list of objects from the
// database and place a reference to this list in the
// request object
List usersList= UsersService.getInstance().getUsersList();
request.setAttribute("vipdatas",usersList);



..

..p..List of Users In ..code..Users../code.. table of database ..code..User Info ../code...../p..
..table border="1"..
..logic:iterate id="element" name="vipdatas" scope="request" type="com.planters.hibernate.Users"..
..tr..
..td....bean:write name="element" property="UName"/..../td..
..td....bean:write name="element" property="PWord"/..../td..
..td....bean:write name="element" property="Permitions"/..../td..
../tr..
../logic:iterate..
../table..
..p..Submit to Add a User:../p..
..!-- This form will post the submitted data to the AddUsersData action Mapping --..
..html:form action="AddUsersData.do" method="post"..
..table border="1"..
..tr....td..User Name:../td....td....html:text property="UName" /..../td..
..td..Password:../td....td....html:text property="PWrod" /..../td..../tr..
..td..Permitions:../td....td....html:text property="Permitions" /..../td..../tr..
../table....br/..
..html:submit/..
../html:form..

../body..
../html:html..
 
 View user's profile Send private message  
Reply with quote Back to top
support-rkalla
Post subject:   PostPosted: Oct 21, 2004 - 05:49 AM
Registered Member
Registered Member


Joined: Jan 06, 2004
Posts: 23824

:|

Please repost the code using code tags wrapping the code, please hit "Post Reply" and click the "Code" button to get the necessary tags to wrap your code.

Also can you explain what your problem is again? We handle a lot of questions a day, and its hard to keep them all straight at times exactly what the issue is.

_________________
Riyad
MyEclipse Support
 
 View user's profile Send private message Visit poster's website  
Reply with quote Back to top
eswearg
Post subject: Hibernate Problum[special request to Mr.Kalla]  PostPosted: Oct 21, 2004 - 07:20 AM



Joined: Oct 20, 2004
Posts: 4

Hi!
Iam new to struts,iam learing struts using myeclips.i was going through the Hibernate demo recording and made a BasicDB project.
so far everything is fine.when i run the project iam getting a message like <vipdatas no bean found>.can any one plz tell me how do i can sort it out.
where do i can set <vipdatas>.
-->in AddUserData.jsp[AddVipData.jsp].
code is:

Code:

[%@ page language="java"%]
[%@ taglib uri="http://jakarta.apache.org/struts/tags-bean" prefix="bean" %]
[%@ taglib uri="http://jakarta.apache.org/struts/tags-html" prefix="html" %]
[%@ taglib uri="http://jakarta.apache.org/struts/tags-logic" prefix="logic" %]
[%@ taglib uri="http://jakarta.apache.org/struts/tags-tiles" prefix="tiles" %]
[%@ taglib uri="http://jakarta.apache.org/struts/tags-template" prefix="template" %]
[%@ taglib uri="http://jakarta.apache.org/struts/tags-nested" prefix="nested" %]


[%@ page import="com.planters.hibernate.UsersService"%]
[%@ page import="java.util.List"%]


[html:html locale="true"]
  [head]
    [html:base /]
   
    [title]Users Example[/title]
   
    [meta http-equiv="pragma" content="no-cache"]
    [meta http-equiv="cache-control" content="no-cache"]
    [meta http-equiv="expires" content="0"]   
    [meta http-equiv="keywords" content="keyword1,keyword2,keyword3"]
    [meta http-equiv="description" content="This is my page"]
  [/head]
 
  [body]
 
   [h3]Users Example[/h3]
   [html:errors/]
   
   [%
   // This code will Generate a list of objects from the
   // database and place a reference to this list in the
   // request object
   List usersList= UsersService.getInstance().getUsersList();
   request.setAttribute("vipdatas",usersList);
   
   
   
   %]
   
   [p]List of Users In Users table of database User Info .[/p]
[table border="1"]
   [logic:iterate id="element" name="vipdatas" scope="request" type="com.planters.hibernate.Users"]
      [tr]
      [td][bean:write name="element" property="UName"/][/td]
      [td][bean:write name="element" property="PWord"/][/td]
      [td][bean:write name="element" property="Permitions"/][/td]
      [/tr]
   [/logic:iterate]
[/table]
[p]Submit to Add a User:[/p]
[!-- This form will post the submitted data to the AddUsersData action Mapping --]
[html:form action="AddUsersData.do" method="post"]
[table border="1"]
   [tr][td]User Name:[/td][td][html:text property="UName" /][/td]
   [td]Password:[/td][td][html:text property="PWrod" /][/td][/tr]
   [td]Permitions:[/td][td][html:text property="Permitions" /][/td][/tr]
[/table][br/]
[html:submit/]
[/html:form]

  [/body]
[/html:html]


Error Message..
javax.servlet.ServletException: Cannot find bean vipdatas in scope request
org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:673)
org.apache.jsp.AddUserData_jsp._jspService(AddUserData_jsp.java:205)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:133)
javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:311)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:301)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:248)
javax.servlet.http.HttpServlet.service(HttpServlet.java:856)


root cause

javax.servlet.jsp.JspException: Cannot find bean vipdatas in scope request
org.apache.struts.util.RequestUtils.lookup(RequestUtils.java:940)
org.apache.struts.taglib.logic.IterateTag.doStartTag(IterateTag.java:277)
org.apache.jsp.AddUserData_jsp._jspService(AddUserData_jsp.java:142)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:133)
javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:311)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:301)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:248)
javax.servlet.http.HttpServlet.service(HttpServlet.java:856)


note The full stack trace of the root cause is available in the Tomcat logs.


--------------------------------------------------------------------------------

Apache Tomcat/5.0.12
 
 View user's profile Send private message  
Reply with quote Back to top
support-rkalla
Post subject:   PostPosted: Oct 21, 2004 - 02:53 PM
Registered Member
Registered Member


Joined: Jan 06, 2004
Posts: 23824

This code looks perfectly fine... the only thing I can think of, is if vipdatas is null when it returns from the method call, and you are setting a null in the request scope... you can add a printout there to check it.

_________________
Riyad
MyEclipse Support
 
 View user's profile Send private message Visit poster's website  
Reply with quote Back to top
Display posts from previous:     
Jump to:  
All times are GMT - 6 Hours
Post new topic   Reply to topic
View previous topic Printable version Log in to check your private messages View next topic
Powered by PNphpBB2 © 2003-2004 The PNphpBB Group
Credits