Results 1 to 10 of 10
- 03-17-2011, 06:58 AM #1
Member
- Join Date
- Mar 2011
- Posts
- 5
- Rep Power
- 0
experiencing a problem using Hibernate featuring JSP..pl help :( :(
i created a jsp application in hibernate using myeclipse8.6...n wen i kept it on server to access its give error as jsp cud not be compiles..Compilation of JSP File '/MyJsp.jsp' failed:
MyJsp.jsp:4:18: The import org.hibernate cannot be resolved
<%@ page import="org.hibernate.cfg.*" %>
^-----------------^
MyJsp.jsp:5:18: The import org.hibernate cannot be resolved
<%@ page import="org.hibernate.*" %>
^-------------^
MyJsp.jsp:6:18: The import org.hibernate cannot be resolved
<%@ page import="org.hibernate.SessionFactory" %>
^--------------------------^
MyJsp.jsp:15:1: Configuration cannot be resolved to a type
Configuration cfg=new Configuration();
^----------^
MyJsp.jsp:15:23: Configuration cannot be resolved to a type
Configuration cfg=new Configuration();
^----------^
MyJsp.jsp:17:1: SessionFactory cannot be resolved to a type
SessionFactory sf=cfg.buildSessionFactory();.......
my jsp is as follows:
<%@ page language="java" import="java.util.*" pageEncoding="ISO-8859-1"%>
<%@ page import="my.pack.Product"%>
<%@ page import="org.hibernate.cfg.*" %>
<%@ page import="org.hibernate.*" %>
<%@ page import="org.hibernate.SessionFactory" %>
<%
String pid1=request.getParameter("pid");
String pname=request.getParameter("pname");
String price=request.getParameter("price");
long vpid=Long.parseLong(pid1);
float vprice=Float.parseFloat(price);
%>
<%
Configuration cfg=new Configuration();
cfg.configure();
SessionFactory sf=cfg.buildSessionFactory();
Session hsession = sf.openSession();
Transaction tx=hsession.beginTransaction();
my.pack.Product pid=new my.pack.Product();
pid.setPid(vpid);
pid.setPname(pname);
pid.setPrice(vprice);
hsession.save(pid);
tx.commit();
hsession.close();
%>
please suggest..thanx in adnvc...
- 03-17-2011, 09:24 AM #2
I advice you don't use any Java code in JSP.For this aim you can use JSTL library.
About your problem you just forgot to set some libraries for Hibernate in classpath.Skype: petrarsentev
http://TrackStudio.com
- 03-17-2011, 03:22 PM #3
Member
- Join Date
- Mar 2011
- Posts
- 5
- Rep Power
- 0
k.. i'm new to hibernate can u plz elobrate about setting classpath in hibernate..i mean wic library files..i did this using myeclipse ide..pl sugest
- 03-18-2011, 08:03 AM #4
Ok. Have you ever made some app with use Hibernate without JSP?
Skype: petrarsentev
http://TrackStudio.com
- 03-18-2011, 01:35 PM #5
Member
- Join Date
- Mar 2011
- Posts
- 5
- Rep Power
- 0
yeah i did jus to store data in database.. n perform all manipulations like to delete ,update etc.. setting classpath does dat mean i nead to place hibernate core libraries in lib folder of my project.. please reply soon ..wating for u answer..:(
- 03-18-2011, 01:50 PM #6
Ok If you know as to delete, update etc. What is problem? You can pass some information from jsp to special class, which to make these manipulations. That is all.
Skype: petrarsentev
http://TrackStudio.com
- 03-18-2011, 01:59 PM #7
Member
- Join Date
- Mar 2011
- Posts
- 5
- Rep Power
- 0
oh no its not about spcl class.. please look at my code..
- 03-18-2011, 02:05 PM #8
I repeat you have mistake in classpath. Can you explain steps as you build and deploy your app?
Skype: petrarsentev
http://TrackStudio.com
- 03-18-2011, 02:22 PM #9
Member
- Join Date
- Mar 2011
- Posts
- 5
- Rep Power
- 0
i simply created a webproject in myeclipse n den added the above jsp..n while adding hibernate capabilities all the jar files wer added to main project folder but not inside web-inf..bb4 dat created a product table in db explorer and added hibernate reverse engg later its pojo class was visible in my main project folder simply took it n run using weblogic.. pleaz gracious n elobrate.. thnkqqqq:)
- 03-18-2011, 02:41 PM #10
I don't want to make this task for you.
so I want that you self to elaborate in this topic.
Is it task from your Uni or are you really want to figure out in this subject?
Sure I can make short example which show as you can make this, but I don't want.Skype: petrarsentev
http://TrackStudio.com
Similar Threads
-
problem in hibernate
By jperson in forum JDBCReplies: 1Last Post: 01-11-2011, 10:10 AM -
display tag hibernate problem
By rajiv in forum JavaServer Pages (JSP) and JSTLReplies: 2Last Post: 07-16-2010, 12:21 PM -
composite-id problem hibernate
By javadev in forum JDBCReplies: 14Last Post: 07-27-2009, 06:30 PM -
Hibernate cache problem
By jispat in forum New To JavaReplies: 0Last Post: 12-29-2008, 11:18 AM -
problem in hibernate need help!
By jrgahan in forum Advanced JavaReplies: 0Last Post: 05-22-2008, 09:00 AM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks