473,396 Members | 2,018 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Importing in jsp and java

77
I have two classes in two different packages.
MyClass is in mypackage and YourClass in yourpackage.
I imported MyClass in YourClass.
For example,

import mypackage.MyClass;

and MyClass has a static variable(Class variable) named myStatic.

and i used it some thing like

someVarible = myStatic;

this compiles good.

But i did the same thin in a jsp file. There it wont compiled.

Then i changed my code as,

someVariable = MyClass.myStatic;

Now it compiles successfully.


Why it happens like this ?

Am I wrong ?

Thanks,
P.Jerald
Oct 30 '07 #1
2 1224
r035198x
13,262 8TB
I have two classes in two different packages.
MyClass is in mypackage and YourClass in yourpackage.
I imported MyClass in YourClass.
For example,

import mypackage.MyClass;

and MyClass has a static variable(Class variable) named myStatic.

and i used it some thing like

someVarible = myStatic;

this compiles good.

But i did the same thin in a jsp file. There it wont compiled.

Then i changed my code as,

someVariable = MyClass.myStatic;

Now it compiles successfully.


Why it happens like this ?

Am I wrong ?

Thanks,
P.Jerald
someVarible = myStatic; is legal only inside the class where the myStatic variable is defined. It won't work in any other class (e.g in a JSP)
Oct 30 '07 #2
pjerald
77
someVarible = myStatic; is legal only inside the class where the myStatic variable is defined. It won't work in any other class (e.g in a JSP)

Thanks,
r035198x

I got it.
Oct 30 '07 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: lawrence | last post by:
What is the PHP equivalent of messaging, as in Java?
3
by: pythos | last post by:
Newbie at python (but not programming) here... I have a program that has "import os" at the top, and then later a call to utime() is made. The python interpreter says "name 'utime' is not...
12
by: qwweeeit | last post by:
The pythonic way of programming requires, as far as I know, to spread a big application in plenty of more manageable scripts, using import or from ... import to connect the various modules. In...
1
by: krc | last post by:
Hello, is it possible to import a jar into J++.net? I want to using Apache POI in J++ .net but can find how to install the classpath. ...Thanks in advance
8
by: anon | last post by:
Hi, Newbie to Python and I have a question please. I am using Windows XP, SPE 0.8.2.a and Python24. I have done this: import sys print sys.path no problem there, sys imports just fine. ...
4
by: unholydreadlord | last post by:
Hi i was wondering if it is possible to import a jpeg picture file for it to be displayed in java. If it is possible, can sum1 plz help me with the code.
2
by: iheartvba | last post by:
Hi, I have a PDF document from which I would like to transfer data to Access, the problem is that I want to select data which is not in the same place everytime. There are 2 ways I have thought of...
1
by: poldoga | last post by:
Good day sirs, I am currently working on creating windows GUI software for a hardware device. The hardware's functions are stored in a DLL. Here is the structure for a function I need to import ...
4
by: minifish | last post by:
Hello experts, I'm try to import java file in unix. Under bash, I tried export CLASSPATH=/blah/blah/some.jar:/blah/some2.jar The CLASSPATH variable was initially undefined. and when I try to...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.