`

Inline Code Example Here

`

<%@ page language="java" contentType="text/html; charset=ISO-8859-1"%>
 <html>
<head>   
 <%@ page import="java.io.*"  %>

<%@ page import="java.io.*"  %>
<%@ page import ="net.sf.mpxj.MPXJException " %>
 <%@ page  import=" net.sf.mpxj.ProjectFile" %>
  <%@ page import=" net.sf.mpxj.Resource" %>
 <%@ page  import=" net.sf.mpxj.Task" %>
 <%@ page  import=" net.sf.mpxj.mpp.MPPReader" %>
 <%@ page  import ="net.sf.mpxj.reader.ProjectReader"  %>

<title>Insert title here</title>
</head>
<body>


<%
final class Mpx 
{

      public void mppReader()
      {
          ProjectReader reader = new MPPReader();
          ProjectFile project;
         System.out.print("before reading");
            try 
            {

                project = reader.read("b4ubuild_sample_2k-03.mpp");
                 //b4ubuild_sample_2k-03
            } 
            catch (MPXJException e)
            {

                e.printStackTrace();
            }

            for (Resource resource : project.getAllResources())
            {

                System.out.println("Resource: " + resource.getName() + " \n(Unique ID=" +resource.getUniqueID() + ")");
                System.out.println("\n");
            }


        for (Task task : project.getAllTasks())
            {
                System.out.println("Task:        " + task.getName() + " ID=" + task.getID() + " Unique ID=" +
            task.getUniqueID()+ "\nStart Date : " +task.getStart()+"\nFinish Date : "+task.getFinish()+ "\nDuration : "
                        +task.getDuration().getDuration());
                System.out.println("\n");
            }

        System.out.println("after reading");
     }
public void main(String[] args)
{
      Mpx fileReader = new Mpx();
      fileReader.mppReader();
}
      }%>
</body>
</html>

can any one help me out i m getting error as
"An error occurred at line: 8 in the generated java file
Only a type can be imported. net.sf.mpxj.MPXJException resolves to a package"

have you tried to import net.sf.mpxj.*
if you want to import all folders and file here from the directory mpxj

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.