| View previous topic :: View next topic |
| Author |
Message |
daniel
Joined: 07 Nov 2009 Posts: 1
|
Posted: Sat Nov 07, 2009 8:15 am Post subject: including a class file without main at the default package in jsp web development |
|
|
I have created a class file only with variable declaration as follows.
NetBeans IDE 6.7.1 - Web Application
index.jsp at "Web Pages"
class: initData.java at Source Packages/default package
public class initData {
public String[] teststr = {"test1", "test2"}
}
The class is created as a java class.
I want to use the variable "teststr" at the index.jsp, but when I compiled index.jsp, the variable name is not recognized.
My actions:
1) classpath should be OK since it is the default package.
2) <@page import = "initData" %>
error: need "."
3) "can not find symbol" (teststr) message
4) tried to compile the class file (initData), but could not do it because it does not have main.
My intention is to define the initial variables in a separate java file, and use the variables at the jsp files in the same web app package.
Hope someone can help me on this. Thanks. |
|
| Back to top |
|
 |
|
|
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 You cannot vote in polls in this forum You can attach files in this forum You can download files in this forum
|
|
|
|