FeaturesPluginsDocs & SupportCommunityPartners

NetBeans Forums

 FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister   ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
  

including a class file without main at the default package in jsp web development

 
Post new topic   Reply to topic    NetBeans Forums -> NetBeans Users
View previous topic :: View next topic  
Author Message
daniel



Joined: 07 Nov 2009
Posts: 1

PostPosted: Sat Nov 07, 2009 8:15 am    Post subject: including a class file without main at the default package in jsp web development Reply with quote

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
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    NetBeans Forums -> NetBeans Users All times are GMT
Page 1 of 1

 
Jump to:  
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


Powered by phpBB