-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 
Author Message
 Post subject: experiencing a problem using Hibernate featuring JSP..
PostPosted: Thu Mar 17, 2011 11:45 am 
Newbie

Joined: Thu Mar 17, 2011 2:15 am
Posts: 1
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...


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.