Note that there are some explanatory texts on larger screens.

plurals
  1. POI am not able to parse the string in java to long
    text
    copied!<pre><code>protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { // TODO Auto-generated method stub Transactions trans=new Transactions(); System.out.println(request.getParameter("assetid")); System.out.println(request.getParameter("barcodeno")); System.out.println(request.getParameter("location")); System.out.println(request.getParameter("employeeid")); System.out.println(request.getParameter("categoryid")); String categoryId=request.getParameter("categoryid"); String employeeId=request.getParameter("employeeid"); String Assetid=request.getParameter("assetid"); String locationcode=request.getParameter("locationcode"); long AssetId=Long.parseLong(Assetid); long categoryid123=Long.parseLong(categoryId); long employeeid=Long.parseLong(employeeId); long LocationCode=Long.parseLong(locationcode); System.out.println("here the employeeId id is"+employeeId); System.out.println("here the Assetid id is"+Assetid); trans.setBarcodeno(request.getParameter("barcodeno")); trans.setLocation(new LocationMaster(LocationCode)); trans.setAssetId(AssetId); trans.setCategory(new CategoryMaster((categoryid123))); trans.setEmployee(new EmployeeMaster(employeeid)); //trans.setEquipment(new EquipmentMaster(employeeid)); SessionFactory sessionFactory=HibernateUtil.getSessionFactory(); Session sessionHb=sessionFactory.openSession(); Transaction tx=sessionHb.beginTransaction(); HttpSession session=request.getSession(); sessionHb.save(trans); System.out.println("transition saved"); tx.commit(); response.sendRedirect("Assetisued.jsp"); //CategoryMaster categorymaster =; } </code></pre> <p>The following are the values which i get from before parsing</p> <pre><code>Asset id=101 Categoryid=1 Barcode =1 Employeeid=10 locationid=1 </code></pre> <p>Dear sir i am not able to parse the string values into long as it is giving <code>NumberFormatException</code>. I am able to get all string values as shown. I checked everything but unable to understand what exactly the problem is. Please check it and give me your feedback...</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload