jsp - Code is Working Properly in NetBeans but not in Eclipse -


i have tried following jsp file in both ides. working in netbeans, not working in eclipse. program time ntp server.

code follows

 <%--  document   : getntp created on : may 21, 2013, 2:21:29 pm author     : maximin --%> <%@page import="java.net.inetaddress"%> <%@page import="java.text.simpledateformat"%> <%@page import ="java.util.date"%>  <%@page import="org.apache.commons.net.ntp.ntpudpclient"%> <%@page import="org.apache.commons.net.ntp.timeinfo"%> <%@page contenttype="text/html" pageencoding="utf-8"%> <!doctype html> <html> <head>     <meta http-equiv="content-type" content="text/html; charset=utf-8">     <title>jsp page</title> </head> <body>     <h1><%     string time_server = "time.nist.gov";     ntpudpclient timeclient = new ntpudpclient();     inetaddress inetaddress = inetaddress.getbyname(time_server);     timeinfo timeinfo = timeclient.gettime(inetaddress);     long returntime = timeinfo.getreturntime();     date time = new date(returntime);             simpledateformat sdf= new simpledateformat("dd-mm-yyyy");             out.println(sdf.format(time));     %></h1> </body> </html> 

when run in eclipse as

org.apache.jasper.jasperexception: unable compile class jsp:   error occurred @ line: 17 in generated java file type can imported. org.apache.commons.net.ntp.ntpudpclient resolves package  error occurred @ line: 18 in generated java file type can imported. org.apache.commons.net.ntp.timeinfo resolves package   error occurred @ line: 18 in jsp file: /gettime.jsp ntpudpclient cannot resolved type 15: <body> 16: <h1><% 17:         string time_server = "time.nist.gov"; 18:         ntpudpclient timeclient = new ntpudpclient(); 19:         inetaddress inetaddress = inetaddress.getbyname(time_server); 20:         timeinfo timeinfo = timeclient.gettime(inetaddress); 21:         long returntime = timeinfo.getreturntime(); 

why so?

what should make run on eclipse?

worked me:

"right click on project , choose properties (it's @ bottom...probably). deployment assembly 1 of pages. if jar ntp classes not in webcontent/web-inf/lib or otherwise on server, make sure on page."

answered nitind


Comments

Popular posts from this blog

blackberry 10 - how to add multiple markers on the google map just by url? -

php - guestbook returning database data to flash -

delphi - Dynamic file type icon -