I'm fairly new to Eclipse/JSP/Beans, but I have to make a project where I use Beans in my JSP file. I have two projects. A)Maven project that includes the JSP file B)EJB project with the Beans
I tried to import a bean in my JSP file with the following line:
<%@page import="beans.TestSessionBean"%>
I also added the EJB project to Project A's build path(right click Project A > Build Path > Configure Builde Path >Projects > Add), but that didn't seem to help.
So whenever I try to run my JSP file, I get the following message:
Only a type can be imported. beans.TestSessionBean resolves to a package
After looking around the internet.. it seems like Project A wouldn't include the files (beans) from Project B. At lasts thats how the content of my WAR file looks:
my-webapp
|-- META-INF
| `-- MANIFEST.MF
|--maven
| `-- directory
| `-- directory
| |--pom.properties
| |--pom.xml
|-- WEB-INF
| |-- classes
| | |-- files
| | | `-- some_file.java
| |-- glassfish-web.xml
| `-- web.xml
`-- index.jsp
but, I saw in another page that its also supposed to include the bean files from Project B, right? (or do I mix up things here?)
I also wanted to know if I might have to edit some XML file to get this stuff working. I keep running into search results that mention the WEB.xml file, but I have no idea if I'm supposed to add anything to it or not. So my WEB.xml looks like this:
<!DOCTYPE web-app PUBLIC
"-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
"http://java.sun.com/dtd/web-app_2_3.dtd" >
<web-app>
<display-name>Archetype Created Web Application</display-name>
<servlet>
<servlet-name>tesLet</servlet-name>
<display-name>tesLet</display-name>
<description></description>
<servlet-class>servlet.tesLet</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>tesLet</servlet-name>
<url-pattern>/tesLet</url-pattern>
</servlet-mapping>
</web-app>
I also had two more questions. What happens if I go to the project properties and add a Project to the Project Preferences settings? (I mean if I check one of the check boxes next to a project)
And what does the checkbox do in the "Order and Export" tab under Build Path?