| JWS Program problem with MAC |
|
 |
Index ‹ java-programmer
|
- Previous
- 2
- dragging a transparent JFrameI'm able to get a transparent JFrame using java 1.4+ on Mac OS X. I
simply set the JFrame's background to a transparent color. However,
with a transparent color (any alpha component less than 255), when I
drag within the JFrame (not the titlebar), it drags the entire JFrame
with it. This makes for unexpected results when dragging an object
within the JFrame that also drags the entire JFrame.
Any ideas?
- 5
- Error handling java GUILet's say that I'm reading the inputs from a TextField widget:
JTextField jt = new JTextField(20);
String text = jt.getText();
if ( !text.equals("OK") )
{
// print some error message to the user
}
If the input is bad, I want to print some error message to the user but
at the same time I don't want to exit my GUI. How do I do that? Should
I be using exceptions? Can someone point me to some sample codes
somewhere on how error handling is performed in JAVA?
Thanks
Thierry
- 6
- Questions about porting a Java applicationHi all,
I have a Java application that I want to port and I have read the better
part of [1]. The application that I want to port unfortunately has a
specific structure that does NOT make it possible to adhere to the
practices. What is the general thing to do in such a case?
As far as I can tell from the Win32 starter script for the application it
insists on an application
directory with the following structure
INSTALL-DIR
|
+---- bin
|
+---- doc
|
+---- lib
Any advice about this?
Kind regards,
Manfred Riem
email***@***.com
[1] Porter's Handbook - Using Java - Best practices
http://www.freebsd.org/doc/en_US.ISO8859-1/books/porters-handbook/using-java
.html#JAVA-BEST-PRACTICES
_______________________________________________
email***@***.com mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-java
To unsubscribe, send any mail to "email***@***.com"
- 6
- Backing up databasesI am looking to write some basic scripts to back-up various files and
databases as well as restore them. Do you think this would be easier
and better to do using Ant or Ruby?
I would appreciate any insight available.
Thanks!
- 6
- JDK + SDKHi,
why i need JDK and JRE together. I don't understand it:
1. I can install JDK + JRE in a packet on my maschine. So i have two Folders
JDK1.5.0_06 and JRE1.5.0_06
2. only JDK
3. only JRE
If i install JDK so there is a folder in it with JDK1.5.0_06/jre/ there the
JRE ist include.
So why i must install jre separately? I want to that my browser must be use
this included jre in jdk !!!
There is the diffrent between?
thx a lot
AdrianP
- 8
- Package Naming Best PracticesSteven Garcia wrote:
> Is this inadvisable? On one hand it provides clarity for the classes
> in a package, on the other hand that clarity might confuse those who
> are really familiar with the Java API.
As it doesn't follow the package naming specification, I'd say you need
to modify your approch somewhat.
As you don't own the rights to the Java API (or the Java name), it
might be better to instead use the following, which would comply with
the spec:
net.domainname.mp.lang
net.domainname.mp.text
net.domainname.mp.util
net.domainname.mp.io
...etc.
That's my advice -- you're welcome to use it or ignore it as it suits
you :).
HTH!
Brad BARCLAY
--
=-=-=-=-=-=-=-=-=
From the OS/2 WARP v4.5 Desktop of Brad BARCLAY.
The jSyncManager Project: http://www.jsyncmanager.org
- 8
- Which IDE?Hello
I am a newbe to Java and to programming.
I am looking for an IDE which I can:
Download free from the net
Have a good documentation and tutorials
Be able to get sum help on the compiler itself on this group (or any other
newsgroup)
----
Elisha Dvir
052-3738817
- 8
- Question about Master and Working Memory from Chapter 17 of the Java Language SpecificationOk the following is from Chapter 17 of the Java Language
Specification.
"A variable is any location within a program that may be stored into.
This includes not only class variables and instance variables but also
components of arrays. Variables are kept in a main memory that is
shared by all threads. Because it is impossible for one thread to
access parameters or local variables of another thread, it doesn't
matter whether parameters and local variables are thought of as
residing in the shared main memory or in the working memory of the
thread that owns them.
Every thread has a working memory in which it keeps its own working
copy of variables that it must use or assign. As the thread executes a
program, it operates on these working copies. The main memory contains
the master copy of every variable. There are rules about when a thread
is permitted or required to transfer the contents of its working copy
of a variable into the master copy or vice versa."
Does this mean that, say, in the following code, there are two working
copies of the integer variable X (one belonging to aThread and one
belonging to bThread) and one master copy?
public class TestThread {
public static void main(String[] args) {
aClass a = new aClass();
Thread aThread = new Thread( a );
Thread bThread = new Thread( a );
aThread.start();
bThread.start();
}
}
class aClass implements Runnable{
int X;
public void run( ) {
while (true) {update();}
}
synchronized void update(){
X++;
}
}
- 8
- Variable scope access questionHi,
I am not sure my question is valid or not. It is the following:
public class MyClass {
public void doA() {
int num = 10;
doB();
//Now, num value has been changed
}
public void doB() {
//I need to access and change the value num inside doA. But I don't
know how to do it.
}
}
Is this possible? Thank you for your help.
- 11
- modularity / granularity of security for a Java application (not applet)Can an administrator control the security restrictions for Java
applications, separately from restrictions for native, non-Java apps?
If so, what are (some of) the resources that can be restricted?
Specifically, can a Java application be temporarily prevented from using
network services?
Again, this is for an application, not an applet.
Thanks for any information,
George
- 12
- 13
- Mars CoordinatesDoes anyone know how to convert (x,y) position of the mouse on a map
of Mars to the coordinates of Mars. I know there's a class in java
that is called Coordinate but i don't know how it works.
- 13
- 15
- 15
- Why Java's math expression (power) is so inconvenient and error prone?Hi,
My program need a lot of calculation of power. In many programming
languages,
2**3 = 8; //or
2^3 = 8;
The syntax is clean and easy. But in Java,
Math.pow(2, 3) = 8; //It is so long, and complicated and error prone
Again, in many languages,
EXP(1) = 2.7 //e value
But in Java,
Math.pow(Math.E, 1) = 2.7 //You see, so complicated
Normally, in one calculation, 2**3 or EXP(3.5) is only part of
expression, like "a + b**3 + EXP(-a)". In Java, it will be very long and
error prone!
|
| Author |
Message |
John B. Matthews

|
Posted: 2008-3-23 9:26:00 |
Top |
java-programmer, JWS Program problem with MAC
In article <47e58b1b$0$1630$email***@***.com>,
Knute Johnson <email***@***.com> wrote:
> http://rabbitbrush.frazmtn.com/aviation/
Here's the diagnostic info from a failed run on Mac OS 10.4.11 (ppc),
java version 1.5.0_13:
[General]
An error occurred while launching/running the application.
Category: Launch File Error
No JRE version found in launch file for this system
[Launch File]
<?xml version='1.0' encoding='UTF-8' ?>
<jnlp spec='1.0+'
codebase='http://rabbitbrush.frazmtn.com/aviation'
href="flightlog.jnlp">
<information>
<title>VFR Flight Log</title>
<vendor>Knute Johnson Software</vendor>
<homepage href="index.html"/>
<icon kind="splash" href="catalina.jpg" />
</information>
<resources>
<java version='1.5+' />
<jar href='sVFRFlightLog.jar' />
</resources>
<application-desc
main-class='com.knutejohnson.tools.aviation.vfrlog.VFRFlightLog'>
</application-desc>
<security>
<all-permissions/>
</security>
</jnlp>
[Exception]
NLPException[category: Launch File Error : Exception: null : LaunchDesc:
<jnlp spec="1.0+" codebase="http://rabbitbrush.frazmtn.com/aviation/"
href="http://rabbitbrush.frazmtn.com/aviation/flightlog.jnlp">
<information>
<title>VFR Flight Log</title>
<vendor>Knute Johnson Software</vendor>
<homepage href="http://rabbitbrush.frazmtn.com/aviation/index.html"/>
<icon href="http://rabbitbrush.frazmtn.com/aviation/catalina.jpg"
kind="splash"/>
</information>
<security>
<all-permissions/>
</security>
<resources>
<jar
href="http://rabbitbrush.frazmtn.com/aviation/sVFRFlightLog.jar"
download="eager" main="false"/>
</resources>
<application-desc
main-class="com.knutejohnson.tools.aviation.vfrlog.VFRFlightLog"/>
</jnlp> ]
at com.sun.javaws.Launcher.handleLaunchFile(Launcher.java:210)
at com.sun.javaws.Launcher.run(Launcher.java:165)
at java.lang.Thread.run(Thread.java:613)
--
John B. Matthews
trashgod at gmail dot com
home dot woh dot rr dot com slash jbmatthews
|
| |
|
| |
 |
Andrew Thompson

|
Posted: 2008-3-23 10:13:00 |
Top |
java-programmer >> JWS Program problem with MAC
On Mar 23, 12:26爌m, "John B. Matthews" <email***@***.com> wrote:
> In article <47e58b1b$0$1630$email***@***.com>,
> 燢nute Johnson <email***@***.com> wrote:
...
> No JRE version found in launch file for this system
I do not know if it is related, but just noticed
something odd in John's output.
Between your original JNLP file which states
a single Jar (presumably containing a main)..
> ??<jar href='sVFRFlightLog.jar' />
..and how the plug-in interprets that as..
> ??<jar
> href="http://rabbitbrush.frazmtn.com/aviation/sVFRFlightLog.jar"
> download="eager" main="false"/>
..main="false"? How did it conclude that?
The default is that the 'first listed' jar
should contain a main().
I cannot see how it would affect the launch,
but perhaps you should try explicitly stating
that the jar contains the main(). Note that I
cannot see *why* it would be necessary to
specify that - barring a bug in the plug-in.
Andrew T.
PhySci.org
|
| |
|
| |
 |
John B. Matthews

|
Posted: 2008-3-24 0:48:00 |
Top |
java-programmer >> JWS Program problem with MAC
In article <47e5c198$0$1630$email***@***.com>,
Knute Johnson <email***@***.com> wrote:
> Andrew Thompson wrote:
> > On Mar 23, 12:26 pm, "John B. Matthews" <email***@***.com> wrote:
> >> In article <47e58b1b$0$1630$email***@***.com>,
> >> Knute Johnson <email***@***.com> wrote:
> > ...
> >> No JRE version found in launch file for this system
> >
> > I do not know if it is related, but just noticed
> > something odd in John's output.
> >
> > Between your original JNLP file which states
> > a single Jar (presumably containing a main)..
> >
> >> <jar href='sVFRFlightLog.jar' />
> >
> > ..and how the plug-in interprets that as..
> >
> >> <jar
> >> href="http://rabbitbrush.frazmtn.com/aviation/sVFRFlightLog.jar"
> >> download="eager" main="false"/>
> >
> > ..main="false"? How did it conclude that?
> > The default is that the 'first listed' jar
> > should contain a main().
> >
> > I cannot see how it would affect the launch,
> > but perhaps you should try explicitly stating
> > that the jar contains the main(). Note that I
> > cannot see *why* it would be necessary to
> > specify that - barring a bug in the plug-in.
> >
> > --
> > Andrew T.
> > PhySci.org
>
> Thanks guys. I'm pretty sure this must be the problem that my friend
> was running into trying to run the program.
>
> I added a main= to the <jar> element. Please try it again and see if it
> has the same problems.
That fixed it!
John
--
John B. Matthews
trashgod at gmail dot com
home dot woh dot rr dot com slash jbmatthews
|
| |
|
| |
 |
Roedy Green

|
Posted: 2008-3-24 3:26:00 |
Top |
java-programmer >> JWS Program problem with MAC
On Sat, 22 Mar 2008 15:41:30 -0700, Knute Johnson
<email***@***.com> wrote, quoted or indirectly quoted
someone who said :
>http://rabbitbrush.frazmtn.com/aviation/
try removing main="true" from:
<jar href="sVFRFlightLog.jar" main="true" />
You specified the main class explicitly.
also try changing:
<jnlp spec="1.0+"
to <jnlp spec="1.5+"
You are using 1.5 features.
--
Roedy Green Canadian Mind Products
The Java Glossary
http://mindprod.com
|
| |
|
| |
 |
Andrew Thompson

|
Posted: 2008-3-24 10:44:00 |
Top |
java-programmer >> JWS Program problem with MAC
On Mar 24, 11:25燼m, Knute Johnson <email***@***.com>
wrote:
...
> Do you know what features I was using of the JNLP spec that required 1.5?
One way to check is to validate it against the 1.0 DTD.
<http://www.google.com/search?
as_q=jnlp&as_sitesearch=java.sun.com&as_filetype=dtd>
Andrew T.
PhySci.org
|
| |
|
| |
 |
Roedy Green

|
Posted: 2008-3-24 14:31:00 |
Top |
java-programmer >> JWS Program problem with MAC
On Sun, 23 Mar 2008 17:25:34 -0700, Knute Johnson
<email***@***.com> wrote, quoted or indirectly quoted
someone who said :
>Do you know what features I was using of the JNLP spec that required 1.5?
I don't think splash existed in the original spec, neither
main="true".
--
Roedy Green Canadian Mind Products
The Java Glossary
http://mindprod.com
|
| |
|
| |
 |
Roedy Green

|
Posted: 2008-3-24 20:22:00 |
Top |
java-programmer >> JWS Program problem with MAC
On Sat, 22 Mar 2008 21:26:06 -0400, "John B. Matthews"
<email***@***.com> wrote, quoted or indirectly quoted someone who
said :
>Here's the diagnostic info from a failed run on Mac OS 10.4.11 (ppc),
>java version 1.5.0_13:
I get that ALL the time with every JNLP app I try to launch from the
desktop shortcut on my PC. I can get it to work by launching from
inside the browser or from creating my own shortcut with the JNLP file
or JNLP URL.
--
Roedy Green Canadian Mind Products
The Java Glossary
http://mindprod.com
|
| |
|
| |
 |
John B. Matthews

|
Posted: 2008-3-24 22:51:00 |
Top |
java-programmer >> JWS Program problem with MAC
In article <47e6f4fe$0$1630$email***@***.com>,
Knute Johnson <email***@***.com> wrote:
> Roedy Green wrote:
> > On Sat, 22 Mar 2008 15:41:30 -0700, Knute Johnson
> > <email***@***.com> wrote, quoted or indirectly quoted
> > someone who said :
> >
> >> http://rabbitbrush.frazmtn.com/aviation/
> >
> > try removing main="true" from:
> >
> > <jar href="sVFRFlightLog.jar" main="true" />
> >
> > You specified the main class explicitly.
> >
> > also try changing:
> > <jnlp spec="1.0+"
> > to <jnlp spec="1.5+"
> >
> > You are using 1.5 features.
>
> OK. It's now jnlp spec="1.5+" and the main="true" has been removed.
>
> Please try it again.
This new jnlp also runs correctly on Mac OS 10.4.11, Safari 3.1.
--
John B. Matthews
trashgod at gmail dot com
home dot woh dot rr dot com slash jbmatthews
|
| |
|
| |
 |
Roedy Green

|
Posted: 2008-3-25 20:55:00 |
Top |
java-programmer >> JWS Program problem with MAC
On Mon, 24 Mar 2008 10:50:49 -0400, "John B. Matthews"
<email***@***.com> wrote, quoted or indirectly quoted someone who
said :
> http://rabbitbrush.frazmtn.com/aviation/
>> >
I can run it, but the desktop icon does not work. It says I don't have
Java installed.
--
Roedy Green Canadian Mind Products
The Java Glossary
http://mindprod.com
|
| |
|
| |
 |
Andrew Thompson

|
Posted: 2008-3-26 6:46:00 |
Top |
java-programmer >> JWS Program problem with MAC
On Mar 24, 1:41爌m, Knute Johnson <email***@***.com>
wrote:
> Andrew Thompson wrote:
..
> > One way to check is to validate ...
..
> How do do that?
See this post.
<http://groups.google.com.au/group/comp.lang.java.programmer/msg/
ce4940523b837d20>
Extra important since I noticed the order
of elements in that (original) JNLP makes
is utterly invalid.
Anything the plug-in does with an invalid
JNLP is largely random.
(Glad to hear it currently works on Mac., but
I expect it will break again with the next
version if still invalid.)
Andrew T.
PhySci.org
|
| |
|
| |
 |
Lew

|
Posted: 2008-3-26 8:41:00 |
Top |
java-programmer >> JWS Program problem with MAC
Knute Johnson wrote:
> So the program blows up the 6.0 DTD but with the 1.5 I get the following
> message. I have absolutely no idea what it means. And speaking of
> that, what order must the elements be in? I really have no clue what I
> need to do here and I can't find anything that makes any sense.
>
> org.xml.sax.SAXParseException: The content of element type "jnlp" must
> match
> "(information+,security?,resources*,(application-desc|applet-desc|component-desc|in
> staller-desc))".
This message tells you that the 'security' tag, if present, must follow the
'information' tag(s).
> <?xml version="1.0" encoding="UTF-8" ?>
> <jnlp spec="1.5+"
> codebase="http://rabbitbrush.frazmtn.com/aviation"
> href="flightlog.jnlp">
> <information>
> <title>VFR Flight Log</title>
> <vendor>Knute Johnson Software</vendor>
> <homepage href="index.html"/>
> <icon kind="splash" href="catalina.jpg" />
> <offline-allowed/>
> </information>
> <resources>
> <j2se version="1.5+" />
> <jar href="sVFRFlightLog.jar" />
> </resources>
> <application-desc
> main-class="com.knutejohnson.tools.aviation.vfrlog.VFRFlightLog">
> </application-desc>
> <security>
> <all-permissions/>
> </security>
> </jnlp>
Here your 'security' tag is way out of position. It is supposed to precede
the 'resources' tags.
--
Lew
|
| |
|
| |
 |
Andrew Thompson

|
Posted: 2008-3-26 15:49:00 |
Top |
java-programmer >> JWS Program problem with MAC
On Mar 26, 11:54燼m, Knute Johnson <email***@***.com>
wrote:
...
> ...I never would have figured that out, I thought XML tags
> were not ordered.
'Right there with you'. I also thought XML
elements had 'no order' until I tried validating
them against a DTD. Just about every JNLP file
I'd written was invalid, that they (ever, on
any machine) worked was 'pure luck'.
Andrew T.
PhySci.org
|
| |
|
| |
 |
Roedy Green

|
Posted: 2008-3-26 18:20:00 |
Top |
java-programmer >> JWS Program problem with MAC
On Tue, 25 Mar 2008 16:39:01 -0700, Knute Johnson
<email***@***.com> wrote, quoted or indirectly quoted
someone who said :
><jnlp spec="1.5+"
> codebase="http://rabbitbrush.frazmtn.com/aviation"
> href="flightlog.jnlp">
looks fine to me. Is that the DTD for 1.5?
--
Roedy Green Canadian Mind Products
The Java Glossary
http://mindprod.com
|
| |
|
| |
 |
Roedy Green

|
Posted: 2008-3-26 18:22:00 |
Top |
java-programmer >> JWS Program problem with MAC
On Tue, 25 Mar 2008 20:40:34 -0400, Lew <email***@***.com> wrote,
quoted or indirectly quoted someone who said :
>Here your 'security' tag is way out of position. It is supposed to precede
>the 'resources' tags.
Is that not the point of XML that all those fluffy tags mean order is
not supposed to matter?
--
Roedy Green Canadian Mind Products
The Java Glossary
http://mindprod.com
|
| |
|
| |
 |
Roedy Green

|
Posted: 2008-3-26 18:24:00 |
Top |
java-programmer >> JWS Program problem with MAC
On Tue, 25 Mar 2008 09:13:09 -0700, Knute Johnson
<email***@***.com> wrote, quoted or indirectly quoted
someone who said :
>> I can run it, but the desktop icon does not work. It says I don't have
>> Java installed.
>
>What kind of a MAC do you have Roedy?
this is on a Vista PC.
IT is not just your app that does this.
It is the most peculiar thing.
the system32 javaws does not launch desktop shortcuts properly.
BUT if you launch it, with -viewer, it will happily work.
Also the shortcuts modified to use C:\program
files\java\jre1.6.0_05\bin\javaws.exe also work.
--
Roedy Green Canadian Mind Products
The Java Glossary
http://mindprod.com
|
| |
|
| |
 |
Lew

|
Posted: 2008-3-26 20:06:00 |
Top |
java-programmer >> JWS Program problem with MAC
Roedy Green wrote:
> On Tue, 25 Mar 2008 20:40:34 -0400, Lew <email***@***.com> wrote,
> quoted or indirectly quoted someone who said :
>
>> Here your 'security' tag is way out of position. It is supposed to precede
>> the 'resources' tags.
>
> Is that not the point of XML that all those fluffy tags mean order is
> not supposed to matter?
No.
--
Lew
|
| |
|
| |
 |
Roedy Green

|
Posted: 2008-3-27 3:53:00 |
Top |
java-programmer >> JWS Program problem with MAC
On Wed, 26 Mar 2008 10:24:17 GMT, Roedy Green
<email***@***.com> wrote, quoted or indirectly quoted
someone who said :
>the system32 javaws does not launch desktop shortcuts properly.
However, I found something even stranger. If I run the system32
javaws -viewer
I can create shortcuts that work.
The one thing that might explain my troubles is I did a "run as
administrator" during the install to avoid having to click ok to
access some file over and over.
--
Roedy Green Canadian Mind Products
The Java Glossary
http://mindprod.com
|
| |
|
| |
 |
Mark Space

|
Posted: 2008-3-27 6:55:00 |
Top |
java-programmer >> JWS Program problem with MAC
Roedy Green wrote:
> On Tue, 25 Mar 2008 20:40:34 -0400, Lew <email***@***.com> wrote,
> quoted or indirectly quoted someone who said :
>
>> Here your 'security' tag is way out of position. It is supposed to precede
>> the 'resources' tags.
>
> Is that not the point of XML that all those fluffy tags mean order is
> not supposed to matter?
I did some searching, I found this interesting:
<http://www-128.ibm.com/developerworks/xml/library/x-eleord.html>
Some learnings there for me too.
|
| |
|
| |
 |
Andrew Thompson

|
Posted: 2008-3-27 7:02:00 |
Top |
java-programmer >> JWS Program problem with MAC
On Mar 27, 1:14燼m, Knute Johnson <email***@***.com>
wrote:
...
(please consider trimming)
> Where can I find the 1.0 DTD. 營 found the 1.5 and 6.0.
Huhh. I am sure when I first checked
that search URL it was showing a whole
lot more hits, but at the moment it is
just the two. This is not that surprising -
if you use the big G to search JNLP files
on the net, the figures will grow and shrink
by thousands each other week.
I'll let you know if I turn up an URL for
the 1.0 JNLP. It is probably included with
the JNLP 1.0.1 Spec* (but I could not be
bothered downloading it to check).
*
<http://java.sun.com/products/javawebstart/download-spec.html>
Andrew T.
PhySci.org
|
| |
|
| |
 |
Andrew Thompson

|
Posted: 2008-3-28 15:38:00 |
Top |
java-programmer >> JWS Program problem with MAC
On Mar 27, 10:52燼m, Knute Johnson <email***@***.com>
wrote:
> Andrew Thompson wrote:
> > On Mar 27, 1:14 am, Knute Johnson <email***@***.com>
> > wrote:
> > ...
> > (please consider trimming)
..
> ...do I need a DOCTYPE statement for JNLP files?
Errr. I'm gonna' pass that one on to Ms. DTD
to answer. (Don't forget that you're talking
to someone who thought XML elements could be
'any order' - until I tried validating them!)
On a side note. Roedy is running a thread on
c.l.j.programmer in which I seem to recall him
saying he now has valid JNLP DTD (or maybe it
was just) XSD for 1.0, 1.5 & 1.6.
I *prefer* validating against XSD, since it
seems to offer more tests. OTOH, Piotr assures
me there are things that can be specified in
DTDs for which there is no equivalent in XSD.
Andrew T.
PhySci.org
|
| |
|
| |
 |
| |
 |
Index ‹ java-programmer |
- Next
- 1
- JSP codeHi,
I have the following code
<html>
<head>
<title>
Authentication
</title>
</head>
<body>
<%!
private String username = null;
private String password = null;
private boolean completeLoginInformation=true;
%>
<%
username = request.getParameter("username");
password = request.getParameter("password");
%>
<H2><p>Checking authentication...</p></H2>
<%
if (username == null)
{ completeLoginInformation = false;
%><p><H3>Username has been left empty...</H3></p>
<% } %>
<%
if (password == null)
{ completeLoginInformation = false;
%><p><H3>Password has been left empty...</H3></p>
<% } %>
<% if (completeLoginInformation == false) { %>
<p><a href="http://localhost:8080/jsp-examples/cal/Front.jsp">Return
back to Front Page</a></p>
<p><a href="http://localhost:8080/jsp-examples/cal/AdminLog.jsp">Return
back to Administration Authentication</a></p>
<% } else { %>
<p>Need to search in database</p>
<p>All data has been entered</p>
<% } %>
</body>
</html>
Now when username and password arguments are given as empty, the flag
is supposed to be set free and in the web browser shows me the 2 links
given. Instead, the else part is being given.
Can someone help me out
Thanks in Advance
- 2
- Java In A Nutshell, 5th Edition moreWith more than 700,000 copies sold to date, Java in a Nutshell from
O'Reilly is clearly the favorite resource amongst the legion of
developers and programmers using Java technology. And now, with the
release of the 5.0 version of Java, O'Reilly has given the book that
defined the "in a Nutshell" category another impressive tune-up.
In this latest revision, readers will find Java in a Nutshell, 5th
Edition does more than just cover the extensive changes implicit in
5.0, the newest version of Java. It's undergone a complete makeover--in
scope, size, and type of coverage--in order to more closely meet the
needs of the modern Java programmer.
more http://www.cdbook.cn/book.asp?id=676
- 3
- Many to Many CMR with an attributeHi,
I have a db scheme where i have a Many to Many relation but i have to
store an attribute in the mapping table. Then, i thought i could
transform my N-N relation in two 1-N relation, explicitely creating the
mapping table with my own attribute but this table has no primary key
(actually it should be the composition of the two foreign keys). Is it
possible to create an Entity where primary keys is the composition of 2
CMR fields or is there another way to do something like that ?
The db :
Supplier(id, name, ...) <-*--(quantity)--*-> Item(id, name, ..)
which is actually
Supplier(id, name, ...) <-1--*-> Supplier_Item(sup_id, item_id,
quantity) <-*--1-> Item(id, name, ...)
Thanks.
- 4
- short circuit operatorsOn Feb 25, 5:19 pm, Patricia Shanahan <email***@***.com> wrote:
> k-e-n wrote:
>
> ...
>
> > Also as I mention in the list below it is simply not good practice to
> > mix Bitwise and Boolean operators in the same expression, just because
> > you can, does not mean you should.
> ...
> > 3. And I think most important of all: Do Not Mix Boolean Operators and
> > Bitwise Operators in the Same Expression.
>
> Note that "|" and "&" with boolean operands, such as true and false, are
> not bitwise operations. They are boolean operations without
> short-circuiting, so that the right hand side is evaluated regardless of
> the left hand side value. They are only bitwise operators if applied to
> integer operands.
>
> What is wrong with mixing bitwise and boolean operators in the same
> expression? Suppose I want to do something if a particular bit is on in
> either of two ints:
>
> if( (intA & mask) || (intB & mask) )
>
> seems reasonable to me, but it definitely mixes bitwise and boolean
> operations. How would you do it?
>
> Patricia
I would do it as you have done and as Joshua Cranmer suggests, use
parenthesis to make the precedence and more specifically your intent
clear.
To a programmer the parenthesis are sufficient advice, to someone who
seems not to understand precedence or perhaps more specifically wants
to know why the rule(s)
exists and what is the meta-rule behind that, I felt something
stronger was required.
Did you have any problem with any other parts of my comment? I have no
wish to cause offense or create any controversy.
- 5
- random names, yeap im bored/*i think someone should you this to name their baby*/
import java.util.Random;
public class name
{
public static void main(String[] args)
{
String string1;
char char1 = 7;
string1 = " ";
int temp, length;
Random generator = new Random();
length = generator.nextInt(10);
for(int blah = 0;blah <= length;blah++)
{
temp = generator.nextInt(26);
if(temp == 1)
char1 = 65;
if(temp == 2)
char1 = 66;
if(temp == 3)
char1 = 67;
if(temp == 4)
char1 = 68;
if(temp == 5)
char1 = 69;
if(temp == 6)
char1 = 70;
if(temp == 7)
char1 = 71;
if(temp == 8)
char1 = 72;
if(temp == 9)
char1 = 73;
if(temp == 10)
char1 = 74;
if(temp == 11)
char1 = 75;
if(temp == 12)
char1 = 76;
if(temp == 13)
char1 = 77;
if(temp == 14)
char1 = 78;
if(temp == 15)
char1 = 79;
if(temp == 16)
char1 = 80;
if(temp == 17)
char1 = 81;
if(temp == 18)
char1 = 82;
if(temp == 19)
char1 = 83;
if(temp == 20)
char1 = 84;
if(temp == 21)
char1 = 85;
if(temp == 22)
char1 = 86;
if(temp == 23)
char1 = 87;
if(temp == 24)
char1 = 88;
if(temp == 25)
char1 = 89;
if(temp == 26)
char1 = 90;
string1 = string1 + char1;
}
System.out.println(string1);
}
}
- 6
- JDK1.5 with JbossGreetings,
I want to try and work with some EJB3 stuff for a small website hosted on a
FreeBSD 5.4 server and was wondering at the state of JDK1.5 port and if it
is ok to use it with Jboss under FreeBSD.
Thanks
John
- 7
- new error building jdk14I've been having quit a bit of difficulty getting jdk14 built on my new
machine. I think this is a heretofore unreported error.
uname -a output:
FreeBSD new.cognitiongroup.biz 5.4-RELEASE FreeBSD 5.4-RELEASE #0: Sun
May 8 07:00:26 UTC 2005
email***@***.com:/usr/obj/usr/src/sys/GENERIC amd64
The build crashes when it tries to compile interpreterRT_i486.cpp
because it has some ABSTRACT methods defined. I'm shocked that the
build would break because it generates code that can't be compiled.
But, I suspect it's a setting, configuration file, or something simple
because others seem to be getting their jdk14 compiled fine.
Here's the abridged build output:
==============================================================
===> Vulnerability check disabled, database not found
LIBC_R TEST PASSED: All Ok
IMPORTANT: To build JDK 1.4.2 port, you should have at least
1.7Gb of free disk space in build area!
IMPORTANT: To build JDK 1.4.2 port, you should have linux emulation
enabled in the kernel and linux procfs (linprocfs) filesystem
mounted.
Following port compile time options are available:
WITH_DEBUG - install JDK binaries and libraries
with debuging support
MINIMAL - don't build/install mozilla java
plugin, javaws and JDK demos
WITH_IPV6 - enable JDK IPv6 support
===> Extracting for jdk-1.4.2p7
=> Checksum OK for j2sdk-1_4_2-src-scsl.zip.
=> Checksum OK for j2sdk-1_4_2-bin-scsl.zip.
=> Checksum OK for bsd-jdk14-patches-7.tar.gz.
===> jdk-1.4.2p7 depends on executable: zip - found
===> jdk-1.4.2p7 depends on executable: unzip - found
===> Patching for jdk-1.4.2p7
Hmm... Looks like a unified diff to me...
The text leading up to this was:
<snip: patching output>
WARNING: Your build environment has the variable DEV_ONLY
defined. This will result in a development-only
build of the J2SE workspace, lacking the documentation
build and installation bundles.
Sanity check passed.
/bin/mkdir -p ../build/bsd-amd64/hotspot-amd64/tmp
(cd ./../build/bsd-amd64/hotspot-amd64/tmp; \
gmake -f /usr/ports/java/jdk14/work/hotspot/build/bsd/Makefile product \
HOTSPOT_BUILD_VERSION=1.4.2-p7-rschilling_04_nov_2005_11_18
LP64=1 GAMMADIR=/usr/ports/java/jdk14/work/hotspot ; )
gmake[1]: Entering directory
`/usr/ports/java/jdk14/work/control/build/bsd-amd64/hotspot-amd64/tmp'
sh /usr/ports/java/jdk14/work/hotspot/build/bsd/makefiles/buildATree.sh
compiler2 /usr/ports/java/jdk14/work/hotspot bsd i486
(cd bsd_i486_compiler2/product; gmake)
gmake[2]: Entering directory
`/usr/ports/java/jdk14/work/control/build/bsd-amd64/hotspot-amd64/tmp/bsd_i486_compiler2/product'
Removing ../generated/includeDB.current to force regeneration.
cd ../generated; cat
/usr/ports/java/jdk14/work/hotspot/src/share/vm/includeDB_core
/usr/ports/java/jdk14/work/hotspot/src/share/vm/includeDB_gc
/usr/ports/java/jdk14/work/hotspot/src/share/vm/gc_implementation/includeDB_gc_parallelScavenge
/usr/ports/java/jdk14/work/hotspot/src/share/vm/gc_implementation/includeDB_gc_shared
/usr/ports/java/jdk14/work/hotspot/src/share/vm/includeDB_ci
/usr/ports/java/jdk14/work/hotspot/src/share/vm/includeDB_compiler2 >
includeDB
cd ../generated; if [ ! -r incls ] ; then \
mkdir incls ; \
fi
cd ../generated; /usr/local/linux-sun-jdk1.4.2/bin/java -classpath .
MakeDeps diffs UnixPlatform platform.current includeDB.current
/usr/ports/java/jdk14/work/hotspot/build/bsd/platform_i486 includeDB
-firstFile functionAtStart.cpp -lastFile functionAtEnd.cpp
Old database:
computing closures
New database:
reading database: includeDB
computing closures
Deltas:
updating output files
The order of .c or .s has changed, or the grand include file has changed.
writing individual include files
creating functionAtStart.cpp
creating accessFlags.cpp
creating allocation.cpp
creating aprofiler.cpp
creating arguments.cpp
<snip: some output deleted due to length>
creating functionAtEnd.cpp
writing grand include file
writing dependencies file
cd ../generated; cp includeDB includeDB.current
cd ../generated; cp
/usr/ports/java/jdk14/work/hotspot/build/bsd/platform_i486 platform.current
gmake[3]: Entering directory
`/usr/ports/java/jdk14/work/control/build/bsd-amd64/hotspot-amd64/tmp/bsd_i486_compiler2/product'
<snip: more build output omitted, the error is next>
Compiling
/usr/ports/java/jdk14/work/hotspot/src/cpu/i486/vm/interp_masm_i486.cpp
Compiling
/usr/ports/java/jdk14/work/hotspot/src/cpu/i486/vm/interpreterRT_i486.cpp
/usr/ports/java/jdk14/work/hotspot/src/cpu/i486/vm/interpreterRT_i486.cpp:
In static member function `static void
SignatureHandlerLibrary::add(methodHandle)':
/usr/ports/java/jdk14/work/hotspot/src/cpu/i486/vm/interpreterRT_i486.cpp:83:
error: cannot allocate an object of type
`InterpreterRuntime::SignatureHandlerGenerator'
/usr/ports/java/jdk14/work/hotspot/src/cpu/i486/vm/interpreterRT_i486.cpp:83:
error: because the following virtual functions are abstract:
/usr/ports/java/jdk14/work/hotspot/src/share/vm/runtime/signature.hpp:283:
error: virtual void NativeSignatureIterator::pass_float()
/usr/ports/java/jdk14/work/hotspot/src/share/vm/runtime/signature.hpp:284:
error: virtual void NativeSignatureIterator::pass_double()
/usr/ports/java/jdk14/work/hotspot/src/cpu/i486/vm/interpreterRT_i486.cpp:
In static member function `static u_char*
InterpreterRuntime::slow_signature_handler(JavaThread*, methodOopDesc*,
jint*, jint*)':
/usr/ports/java/jdk14/work/hotspot/src/cpu/i486/vm/interpreterRT_i486.cpp:156:
error: cannot allocate an object of type `SlowSignatureHandler'
/usr/ports/java/jdk14/work/hotspot/src/cpu/i486/vm/interpreterRT_i486.cpp:156:
error: because the
following virtual functions are abstract:
/usr/ports/java/jdk14/work/hotspot/src/share/vm/runtime/signature.hpp:283:
error: virtual void NativeSignatureIterator::pass_float()
/usr/ports/java/jdk14/work/hotspot/src/share/vm/runtime/signature.hpp:284:
error: virtual void NativeSignatureIterator::pass_double()
gmake[3]: *** [interpreterRT_i486.o] Error 1
gmake[3]: Leaving directory
`/usr/ports/java/jdk14/work/control/build/bsd-amd64/hotspot-amd64/tmp/bsd_i486_compiler2/product'
gmake[2]: *** [the_vm] Error 2
gmake[2]: Leaving directory
`/usr/ports/java/jdk14/work/control/build/bsd-amd64/hotspot-amd64/tmp/bsd_i486_compiler2/product'
gmake[1]: *** [product] Error 2
gmake[1]: Leaving directory
`/usr/ports/java/jdk14/work/control/build/bsd-amd64/hotspot-amd64/tmp'
gmake: *** [product] Error 2
*** Error code 2
Stop in /usr/ports/java/jdk14.
==============================================================
_______________________________________________
email***@***.com mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-java
To unsubscribe, send any mail to "email***@***.com"
- 8
- jsp:multiple file/directory uploadHello i want to upload mutliple files at a time in jsp
i.e want to upload whole directory or folder at one go
is there any way to do this if any one knows plz let me know
thanks in advance
- 9
- How to start compiling a big package directory tree ?I downloaded a java source of a tool which is spread over multiple (40-50) *.java files
which are located in different sub directories according to their package name.
Unfortunately no further instructions (e.g. Ant script) are available.
However the source should be compileable without errors.
How do I start ?
Which class should I compile first ?
For example I found a "main()" method in java file SomeGUI.java
When I switch now to the base directory of package:
D:\java\base\
and type at the command prompt:
javac org\somepack1\subpack2\SomeGUI.java
then the compiler tell me that he cannot find a file/package "org.somepack.addclass"
But the java file org\soempack\addclass.java EXISTS !
Why does the compiler not find this class/source ?
Can I somehow tell the compiler (from the command line !):
"here is the source directory tree. Search for all you need and compile all
necessary classes in the sequence you need".
Tom
- 10
- Basic jstl problem - Setting a bean propertyHi,
I have a simple class :
public class MyClass {
private String attrib = null;
public MyClass() {}
public void setAttrib(String attrib) {
this.attrib = attrib;
}
public String getAttrib() {
return this.attrib;
}
}
I also have a simple JSP:
<%@ taglib prefix="c" uri="http://java.sun.com/jstl/core" %>
<jsp:useBean id="myclass" class="MyClass"/>
If I try to set the "attrib" property using
<c:set target="${myclass}" property="attrib" value="somevalue"/>
I got an error:
javax.servlet.jsp.JspTagException: Invalid property in <set>:
"attrib"
org.apache.taglibs.standard.tag.common.core.SetSupport.doEndTag(SetSupport.java:160)
I tryed target="${myclass.attrib}", but I receive another error:
javax.servlet.jsp.JspException: An error occurred while evaluating
custom action attribute "target" with value "${myclass.attrib}":
Unable to find a value for "attrib" in object of class "MyClass" using
operator "." (null)
Any help?
TIA,
Bob
- 11
- Mechanism to identify calling object/method?Is there a mechanism within Java (J2SE 5) that would allow me to
identify which object and/or method is calling a target method?
For example, if I have method Class1.foo() that is being called from
Class2.bar(), is there a way for Class1.foo() to identify one or both
of the calling object and method?
-Nedron
- 12
- JavaBean default property editorsI am looking for information on default property editors for JavaBean
properties. There are three cases in which I am hoping that a default
property editor exists for a given property:
1) The property is a collection class of references to other beans of a
particular base type which has already been been added to a bean
context. I am hoping that there is a default property editor which
allows the end-user programmer to add items to the collection, and then
connect each item to an appropriate bean already existing in the bean
context.
2) The property is a reference to another bean of a particular base type
which has already been added to a bean context. I am hoping that there
is a default property editor which allows the end-user programmer to
connect the property to an appropriate bean already existing in the bean
context.
3) A property editor which takes a reference to another bean as an
embedded bean ( one that is already initialized as a reference in the
parent bean ), and allows the embedded bean to expand its own properties.
Do such property editors exist, or do I actually need some sort of
custom property editor in any or all of these common cases ?
- 13
- Authenticating Against Users Defined In a Database - TomcatCould someone point me in the right direction - I'm trying to
authenticate users against a SQL Server database and found plenty of
articles on how to create tables such as user-roles but I want to use
the actual users defined in SQL Server, because the users are also
directly logging into the db. I also tried using NTLM but our
production environment will not allow this.
TIA
- 14
- copying Image to system clipboardHi
As far as I can tell this is not possible to copy an Image to the
system clipboard with java at the moment. However I need it for a
project I'm working on. Has anyone found any hacks to make this
possible? Also, are there any chances that this feature will be
incorporated into the JDK at some point in the future? Are plans in the
offing?
Thanks for any advice.
Michael
- 15
- Problems in printing an IntegerHamvil ha scritto:
> 1) why I get the blank page instead of the usual exception in the jsp
> page?
Ok, I've fixed this (it was a problem with the configuration of the
logger
> 2) why the variable cannot be printed?
In the logger i get the following message:
javax.servlet.jsp.JspException: Cannot find message resources under key
org.apache.struts.action.MESSAGE
What I do not understand is why struts looks for a key in the resources
file. It should just print the integer. Am I missing somethink?
BTW if I add the following in the struts-config the problem look fixed.
Is this the right approach?
<message-resources
parameter="MyWebAppResources"
null="false" />
Thanks
|
|
|