 |
 |
Index ‹ java-programmer
|
- Previous
- 3
- Calling a C routine from .dllHi friends,
I would like call a C routine from Java program that is into a .dll
library. I don't know if this is possible and if so, how can I do it.
Thanks in advance!
Salvador Huertas.
- 4
- Need help creating a grid.Hello I am new to Java AWT/Swing and have a question.
I would like to create a 10x10 grid, where each "cell" can handle mouse
events. So if I click on cell with a coord A4 then it would change color.
I was thinking of using JButtons but I want the "cells" to look more like
Excel-like in appearance. I also found a component called JTable but I do
not think that it can handle mouse events. Any suggestions??
- 4
- Eclipse bug?Eclipse bug? Using most recent version (as of a couple weeks ago,
anyway), if it sits idle for a day or two in the taskbar, it stops
responding -- or at least it is really sluggish if you try to use it
again, and not just for a short time, but until you quit and restart it.
- 4
- pushlet applicationHi
i am now involved in a telnet application.i am using struts frame
work for the application.using some jsp i have to display the contents
retrieved when a telnet connection is established.the program is
working fine for a single command.but if i have to supply multiple
commands then the connection with the action servlet should exist
forever.how is this possible? using some pushlet framework is this
possible? if anyone has any idea pls do tell me.Thanks in advance
- 4
- Dynamic page creation using swingHello,
I have created a user interface using swing which takes a file as input
from the user and has a button for submission purpose. Once the user
clicks on the submit button i want the file to be fed to a particular
server. How do i do this? Is there a way to use scripting languages
like Perl, JavaScript with swing?
Please give your suggestions.
Thanks,
nisha
- 5
- BZip2-Files & JavaOk two things:
I'm trying to get the Apache BZip2 Library to work, but I always get a
NullPointerException. My code looks like this:
[CODE]
void load(String filename) throws FileNotFoundException, IOException {
FileInputStream fis = new FileInputStream(filename);
CBZip2InputStream = new CBZip2InputStream(fis);
}
[/CODE]
As soon as the creation of the CBZip2InputStream is reached, a
NullpointerException is thrown. Why?
Secondly: if the library is corrupted (e.g. doesn't work stable) is
there an alternative to it (Googleing did not help me very much)?
Snyke
- 6
- (WWW.CN-CIRCLE.COM) cheap wholesale prada Shoes,Customized Gucci Shoes,Lacoste trainers ,jordan 23 outlet shoes, and hoodies ,jeans.(WWW.CN-CIRCLE.COM) cheap wholesale prada Shoes,Customized Gucci
Shoes,Lacoste trainers ,jordan 23 outlet shoes, and hoodies ,jeans.
Nike Jordan Discount Shoes at (www.cn-circle.com)
Discount Jordan Basketball Shoes
Discount Jordan Sneakers
Discount Jordans Price Wholesale
Discount Jordan V
Discount Air Jordans
King James Discounts Jordans
nike wholesale distributors
customized nike "tennis shoes"
Cheap Jordan Sneakers
Cheap Jordans and Air Force 1s
online wholesale suppliers of air forces
(www.cn-circle.com) wholesale china
Air Jordans Wholesale Factory Direct
wholesale adidas china
wholesale nike sneakers by bulk
cheap kobe trainers
cheap trainers
(www.cn-circle.com) WHOLESALE JORDAN'S TENNIS
gucci tennis sneakers
Women Customize Air Force Ones
customized sneakers
China Wholesale Nike Sneakers Factory
cheap kobe trainers
Wholesale Custom Air Force One
Jordans Wholesale
Cheap Jordans Wholesale
Jordans Retro Wholesale
Air Jordans Wholesale Custom made Nike Dunks
Nike Shoes Wholesale China
Discount Jordans Price Wholesale
(www.cn-circle.com) Wholesale Nike Distributor
Wholesale Nike Sneaker
Wholesale Nike Air Force 1
Air Clear Force One Wholesale
Nike Air Force Wholesale
Buy Jordans Wholesale
(www.cn-circle.com) Wholesale Nike Tennis Shoes
Jordans Retro Wholesale
Cheapest Nike Web Wholesale
Wholesale Kid Jordans
Wholesale Nike Dunk
Authentic Jordans Wholesale
Nike Shoes Wholesale China
Wholesale Custom Jordans (www.cn-circle.com)
Air China Jordans Wholesale WOMENS NIKE AIR FORCES
Jordans Retro Wholesale
Air China Jordans Wholesale
Nike Air Jordan Wholesale
Wholesale Nike Distributor
Nike Golf Wholesale
Wholesale Jordans
Wholesale Nike Shox
Wholesale Basketball Shoes Nike
Air Jordans Price Wholesale
Jordans Kid Wholesale
Wholesale Air Force One And Jordans (www.cn-circle.com)
Jordans Shoes Wholesale
Wholesale Air Jordans
Air Jordans At Wholesale Price
Wholesale Nike Tennis Shoes
Nike T Shirt Wholesale
Air Force Jordans One Wholesale
Nike Shoes Wholesale Womens
Authentic Jordans Wholesale
Wholesale Air Force One And Jordans (www.cn-circle.com)
Discount Jordans Price Wholesale
Sock Wholesale Nike
Nike Wholesale Outlet
Wholesale Air Force One
China In Jordans Wholesale
Jordans Wholesale
Bulk Wholesale Air Force One
(www.cn-circle.com) Wholesale NIKE Sneakers from our Nike factory to
Nike shop & Nike
store,sale and Wholesale all of Nike stock Shoes,we have many type of
NIKE Sneakers :Nike discount Shoes,Nike cheap Shoes,Nike stock
Shoes(Nike Trainers, Nike Sneakers,Nike Running Shoes,Nike Basketball
Shoes,Nike Discount Shoes,Nike Cheap Shoes,footwear, Sports
Shoes)Nike
Shoes Wholesale sizes include:Nike men's Shoes,Nike women's
Shoes,Nike
mens Shoes,Nike womens Shoes, Nike men Shoes,Nike women Shoes,Nike
kids Shoes, Nike child Shoes.Nike discount Shoes,Nike cheap
Shoes,china Nike Shoes,Nike Shoes Wholesale,Jordan SHOES,Air Force
one
1s,Nike Shox,Nike shoe Air max wholesale price.china wholesale
sneakers Nike celebrates 25 birthday of Air Force Ones BUY SELL NIKE
SHOX JORDAN MAX TIMBERLAND AIR FORCE PRADA TN PUMA
red monkey evisu bapes bathing ape lrg clh jeans hoodies shoes
sneakers wholesale,jordans and nike from china
authentic jordans wholesale
Our webside: www.cn-circle.com and http://nikesneakertrade.photo.163.com
- 6
- Bug#438188: RFP: schemaspy -- Graphical Database Schema Metadata BrowserPackage: wnpp
Severity: wishlist
* Package name : schemaspy
Version : 3.1.1
Upstream Author : John Currier <email***@***.com>
* URL : http://schemaspy.sourceforge.net/
* License : LGPL
Programming Lang: Java
Description : Graphical Database Schema Metadata Browser
SchemaSpy is a Java-based tool (requires Java 1.4 or higher) that
analyzes the metadata of a schema in a database and generates a visual
representation of it in a browser-displayable format. It lets you click
through the hierarchy of database tables via child and parent table
relationships. The browsing through relationships can occur though HTML
links and/or though the graphical representation of the relationships.
It's also designed to help resolve the obtuse errors that a database
sometimes gives related to failures due to constraints.
--
To UNSUBSCRIBE, email to email***@***.com
with a subject of "unsubscribe". Trouble? Contact email***@***.com
- 7
- JCheckBox problem Please helpHi All
My question is how to remove the border from inner rectangle of a
JCheckBox.
A JCheckBox has 2 rectangles,it is possible to remove the boder from the
outside one ,but what about the rectangle where the user clicks.(I am
referring this rectangle as inner rectangle)
Hoping a quick reply
Praveen
--
Message posted via http://www.javakb.com
- 8
- FYI: A new open source/free O/R mapping tool and server page frameworkAnnounce:
A new open-source O/R mapping tool has just been released. There
are many such programs out there...but this one is very
special because it's simple (no xml configuration ! yay) and has
been tested extensively with postgres (and a bit with mysql).
This tool has been used in production enviroments so the
generated code has most bugs squeezed out by now.
If you have a minute, you can check it out at:
http://www.mollypages.org/dbo/
There's also a server-side page type thingy (like JSP) but with
much cleaner syntax (and easy typing).
Enjoy !
- 10
- How to get the path of remotly run application by knowing the port numberHi,
I am new to this group, and i request you all to help in solving the
issues i have.
Thank you for having this group.
I need to know the path or install directory of an application,
I am able to access the the application by port number.
but i need to wright a java programe thr which i need to get the path
or install directory of the application.
Eg
http://servername:2000/
I request you all to help in the same.
- 10
- JSP listing bean propertiesIs it possible to list all Java bean properties with JSP tag?
When some java bean component is chosen than new jsp site must appear with
his properties, events...
- 10
- 10
- How to get mozilla to download a jar file?
I can download jar files without difficulty using Internet Explorer,
but Mozilla instead "displays" them (i.e. fills the screen up with
gibberish).
Does anyone know how to configure Mozilla to download jar files
and save them to disk?
Or is this a server-side problem? (FWIW, I noticed that the server
serving the jar files in question put "text/plain" in the Content-Type
field.)
TIA,
-Irv
- 13
- Using Unicode symbolsI'm trying to use some of the "Miscellaneous Symbols" from the Unicode
character set in a program but getting absolutely nowhere. Can someone
please point me in the right direction for starters?
Thanks
Jim
|
| Author |
Message |
rahul8143

|
Posted: 2005-8-14 18:11:00 |
Top |
java-programmer, byte data type
hello,
I am confused with byte data type. I want to know how following code
gives result as -12?
byte b = (byte) 0xf4;
System.out.println("b=" +(byte)b);
regards,
rahul
|
| |
|
| |
 |
Boudewijn Dijkstra

|
Posted: 2005-8-14 19:38:00 |
Top |
java-programmer >> byte data type
<email***@***.com> schreef in bericht
news:email***@***.com...
> hello,
> I am confused with byte data type. I want to know how following code
> gives result as -12?
> byte b = (byte) 0xf4;
> System.out.println("b=" +(byte)b);
The byte type is a signed type. (byte)-12 is equal to (byte)0xf4. (int)0xf4
is too big for byte, so it appears equal to (int)0xfffffff4.
|
| |
|
| |
 |
Roedy Green

|
Posted: 2005-8-15 2:00:00 |
Top |
java-programmer >> byte data type
On 14 Aug 2005 03:11:18 -0700, email***@***.com wrote or quoted :
>I am confused with byte data type. I want to know how following code
>gives result as -12?
>byte b = (byte) 0xf4;
>System.out.println("b=" +(byte)b);
byte is signed. It was an idiotic holdover from the days of C where
chars were 7 bits.
See http://mindprod.com/jgloss/unsigned.html for how to fake unsigned
bytes.
|
| |
|
| |
 |
Thomas Hawtin

|
Posted: 2005-8-15 3:29:00 |
Top |
java-programmer >> byte data type
Roedy Green wrote:
>
> byte is signed. It was an idiotic holdover from the days of C where
> chars were 7 bits.
C does not specify the number of bits to a char. Nor if it is signed or
unsigned (usually they are unsigned). It doesn't even specify if signed
chars use two-complement notation.
I don't really think it is the business of a high level language, such
as Java, to have comprehensive support for bit bashing.
Tom Hawtin
--
Unemployed English Java programmer
http://jroller.com/page/tackline/
|
| |
|
| |
 |
Roedy Green

|
Posted: 2005-8-15 5:11:00 |
Top |
java-programmer >> byte data type
On Sun, 14 Aug 2005 20:29:05 +0100, Thomas Hawtin
<email***@***.com> wrote or quoted :
>C does not specify the number of bits to a char. Nor if it is signed or
>unsigned (usually they are unsigned). It doesn't even specify if signed
>chars use two-complement notation.
Yes they had chaos. When people used only 7-bit ASCII it did not
matter, and the signed was a nice feature to use for short offsets.
Back then you had compiler options to consider byte as signed or
unsigned, but tradition left it signed.
Java went with the signed tradition even though nowadays 99% of the
time you want unsigned. Perhaps sun hardware is signed byte only.
I know Intel circa 386 used be unusually slow at handling signed
bytes.
|
| |
|
| |
 |
Thomas Hawtin

|
Posted: 2005-8-15 5:31:00 |
Top |
java-programmer >> byte data type
Roedy Green wrote:
> On Sun, 14 Aug 2005 20:29:05 +0100, Thomas Hawtin
> <email***@***.com> wrote or quoted :
>
>
>>C does not specify the number of bits to a char. Nor if it is signed or
>>unsigned (usually they are unsigned). It doesn't even specify if signed
>>chars use two-complement notation.
>
>
> Yes they had chaos. When people used only 7-bit ASCII it did not
> matter, and the signed was a nice feature to use for short offsets.
>
> Back then you had compiler options to consider byte as signed or
> unsigned, but tradition left it signed.
I'm pretty sure most compilers went with unsigned (although I may of
course be mistaken). unsigned chars mean you can sensible have EOF as -1.
> Java went with the signed tradition even though nowadays 99% of the
> time you want unsigned. Perhaps sun hardware is signed byte only.
99% of the time you just don't care. It's important if you are doing
byte twiddling to read some format. But then you do it for a few of your
simple datatypes and you're done. The only large use is for constants
used in the formats.
Java has bytes because it has byte arrays. Same with shorts. IMO, it'd
be confusing for some numerical types to be signed and others unsigned.
chars as a numerical type was a mistake.
> I know Intel circa 386 used be unusually slow at handling signed
> bytes.
Surprises me. IIRC, ARMs before the ARM7T (1994) did not have signed
byte loads. As you are on the whole unlikely to do anything that makes
distinguishes between signed and unsigned on 8-bit data, the 1.5
instruction overhead is not a big deal.
Tom Hawtin
--
Unemployed English Java programmer
http://jroller.com/page/tackline/
|
| |
|
| |
 |
googmeister

|
Posted: 2005-8-15 7:14:00 |
Top |
java-programmer >> byte data type
Roedy Green wrote:
> Java went with the signed tradition even though nowadays 99% of the
> time you want unsigned. Perhaps sun hardware is signed byte only.
I suspect most of the time it makes absolutely no difference whether it
is signed or unsigned. For the main operations on bytes (the bitwise
ones) signedness makes no difference except for right shift (but that's
why there's >> and >>>).
Just curious. What other operations are you doing on bytes where the
signedness matters? I would consider printing out bytes in decimal
or doing division on them to be uncommon, but maybe I am wrong.
|
| |
|
| |
 |
Roedy Green

|
Posted: 2005-8-15 16:47:00 |
Top |
java-programmer >> byte data type
On Sun, 14 Aug 2005 22:30:32 +0100, Thomas Hawtin
<email***@***.com> wrote or quoted :
>I'm pretty sure most compilers went with unsigned (although I may of
>course be mistaken). unsigned chars mean you can sensible have EOF as -1.
IIRC C defaulted to signed and C++ defaulted to unsigned for Borland.
All I will say for sure is that it was not defined by the language,
but by a compiler switch.
|
| |
|
| |
 |
Roedy Green

|
Posted: 2005-8-15 16:51:00 |
Top |
java-programmer >> byte data type
On 14 Aug 2005 16:14:23 -0700, email***@***.com wrote or quoted :
>Just curious. What other operations are you doing on bytes where the
>signedness matters?
If you use bytes to index translate tables.
If you are fiddling around flipping endianness.
if you are displaying with decimal or hex.
if you are doing base64 encoding.
if you are doing encryption.
if you are using bytes to compactly store small ints.
if you are playing with RGB
|
| |
|
| |
 |
googmeister

|
Posted: 2005-8-15 19:07:00 |
Top |
java-programmer >> byte data type
Roedy Green wrote:
> On 14 Aug 2005 16:14:23 -0700, email***@***.com wrote or quoted :
>
> >Just curious. What other operations are you doing on bytes where the
> >signedness matters?
>
> If you are fiddling around flipping endianness.
>
> if you are doing base64 encoding.
>
> if you are doing encryption.
>
> if you are playing with RGB
That's a good list of byte applications, but I was really searching
for operations, not applications. It makes no difference if you
just use bitwise operations (using >>> instead of >>), plus,
minus, times, equality. I think the list above falls in this category.
For example, endianness flipping only seems to involve
bit-whacking operations.
> if you are displaying with decimal or hex.
>
> if you are using bytes to compactly store small ints.
OK, if you need to display bytes in decimal or do division/
remainder on small integers, I agree. But how often does
that arise.
> If you use bytes to index translate tables.
Yes, I think using bytes as array indices is a compelling
example, e.g., for any kind of lookup table on bytes.
I can also see how this operation arise in some
of the other applications too.
As I said, I was really looking for operations, not
applications. The array indexing one was exactly the sort
of answer I was searching for. Thanks Roedy!
|
| |
|
| |
 |
Monique Y. Mudama

|
Posted: 2005-8-16 6:36:00 |
Top |
java-programmer >> byte data type
On 2005-08-14, Thomas Hawtin penned:
>
> I don't really think it is the business of a high level language,
> such as Java, to have comprehensive support for bit bashing.
When I was assigned the job of parsing and displaying binary data
generated by a native app in Java, I was really happy that it supported
bit bashing.
--
monique
Ask smart questions, get good answers:
http://www.catb.org/~esr/faqs/smart-questions.html
|
| |
|
| |
 |
Roedy Green

|
Posted: 2005-8-16 9:33:00 |
Top |
java-programmer >> byte data type
On 15 Aug 2005 04:06:45 -0700, email***@***.com wrote or quoted :
>That's a good list of byte applications, but I was really searching
>for operations, not applications. It makes no difference if you
>just use bitwise operations (using >>> instead of >>), plus,
>minus, times, equality. I think the list above falls in this category.
>For example, endianness flipping only seems to involve
>bit-whacking operations.
I could give you some code, e.g.
http://mindprod.com/products1.html#LEDATASTREAM,
http://mindprod.com/products1.html#WRAPPER and you can see how much of
it still works when you yank out all the & 0xff operations.
I can't think of a time I wanted signed bytes in the last 8 years.
|
| |
|
| |
 |
googmeister

|
Posted: 2005-8-16 21:29:00 |
Top |
java-programmer >> byte data type
Roedy Green wrote:
> On 15 Aug 2005 04:06:45 -0700, email***@***.com wrote or quoted :
>
> >That's a good list of byte applications, but I was really searching
> >for operations, not applications. It makes no difference if you
> >just use bitwise operations (using >>> instead of >>), plus,
> >minus, times, equality. I think the list above falls in this category.
> >For example, endianness flipping only seems to involve
> >bit-whacking operations.
>
> I could give you some code, e.g.
> http://mindprod.com/products1.html#LEDATASTREAM,
> http://mindprod.com/products1.html#WRAPPER and you can see how much of
> it still works when you yank out all the & 0xff operations.
Now I see the problematic operation -- it's not any of the bitwise or
arithmetic operations on bytes, but rather the (implicit) cast from a
byte
to an integer.
(byte1 & 0xff ) << 16
> I can't think of a time I wanted signed bytes in the last 8 years.
You've convince me!
One more (related) complaint about bytes - why are bytes (and shorts)
treated like second class primitive types, e.g., they're promoted to
ints so expressions like byte1 = byte2 | byte3 won't compile (although
byte1 |= byte2 is legal)? This only seems to exacerbate the amount of
casting when using (signed) bytes.
|
| |
|
| |
 |
Roedy Green

|
Posted: 2005-8-19 8:01:00 |
Top |
java-programmer >> byte data type
On 16 Aug 2005 06:28:44 -0700, email***@***.com wrote or quoted :
>
>One more (related) complaint about bytes - why are bytes (and shorts)
>treated like second class primitive types, e.g., they're promoted to
>ints so expressions like byte1 = byte2 | byte3 won't compile (although
>byte1 |= byte2 is legal)?
It is because of the JVM. The stack elts are 32 bits wide and most of
th JVM operators that work on the top two stack elts are thus int
operators.
Rememember than Java orginally was designed for TV set top boxes where
you had limited RAM and hence a limited op code set in your JVM.
|
| |
|
| |
 |
Thomas Hawtin

|
Posted: 2005-8-22 22:22:00 |
Top |
java-programmer >> byte data type
Roedy Green wrote:
> On 16 Aug 2005 06:28:44 -0700, email***@***.com wrote or quoted :
>
>
>>One more (related) complaint about bytes - why are bytes (and shorts)
>>treated like second class primitive types, e.g., they're promoted to
>>ints so expressions like byte1 = byte2 | byte3 won't compile (although
>>byte1 |= byte2 is legal)?
>
>
> It is because of the JVM. The stack elts are 32 bits wide and most of
> th JVM operators that work on the top two stack elts are thus int
> operators.
>
> Rememember than Java orginally was designed for TV set top boxes where
> you had limited RAM and hence a limited op code set in your JVM.
There's no reason for a one-to-one mapping from operators to byte codes
(as seen from the |= on bytes). The problem is that if you add to bytes
or shorts together and assign to an int, you should be surprised by
overflows. It's very easy to have an overflow in the middle of an
expression, even if the end result would always be in range were all
operators to work with arbitrary precision.
Like Java byte code, it's normal for modern processor instruction set
architectures not to support eight and sixteen bit arithmetic and logic.
In terms of Java source, it was probably a mistake to allow compound
operator assignments narrow casting.
Tom Hawtin
--
Unemployed English Java programmer
http://jroller.com/page/tackline/
|
| |
|
| |
 |
| |
 |
Index ‹ java-programmer |
- Next
- 1
- TCP protocol in JavaHi all,
I would like to know is it possible to implement a transport
layer protocol such as TCP in java. Although its available in java.net
package, i like to create my own. Also is there any detailed
explanation for source code of java.net package.
Thanks in advance
- 2
- Hotkeys questionAll,
I am currently looking at doing the following. Using a JtextArea/field
create a box that will allow the users to enter hotkeys/shortcut keys.
When you click the box it will only take in the key pressed and display
that (e.g. if you press "a" A will appear, if you press crtl, alt,
shift and b "Crtl + ALT + SHIFT +B" would be displayed.
Does this class exist already (GPL pref).
Ta
Jaj
- 3
- Offset not calculated properlyI'm trying to move a second window so that it is directly above another,
hugging it closely. I'm using the below code, but for some reason, its not
always consistent.. sometimes my second window falls just below the title
bar, sometimes its pretty far below the title bar.
void resetPositionComboTD()
{
Point loc = this.getLocationOnScreen();
int newY = loc.y - sw.getHeight();
int newX = loc.x;
sw.setLocation(newX, newY);
}
I tried playing with insets, but no matter what I did, it didn't seem to
help much (or at all)
Any help is appreciated, I'm driving my self nuts with this
- Craig
#! rnews 572
Xref: xyzzy rec.autos.makers.mazda.miata:150315
Newsgroups: rec.autos.makers.mazda.miata
Path: xyzzy!nntp
From: "Xavier" <email***@***.com>
Subject: Any Mazda3 owners around here?
X-Nntp-Posting-Host: e165148.nw.nos.boeing.com
Message-ID: <email***@***.com>
X-Mimeole: Produced By Microsoft MimeOLE V6.00.2800.1441
X-Priority: 3
X-Msmail-Priority: Normal
Lines: 3
Sender: email***@***.com (Boeing NNTP News Access)
Organization: The Boeing Company
X-Newsreader: Microsoft Outlook Express 6.00.2800.1437
Date: Fri, 4 Mar 2005 00:15:29 GMT
Great car...
- 4
- I am interestedHi My name is Mike and I am interested in the field of Computer
Science.
I want a career in this field and I am wondering do you have any
helpful hints or words of encouragement for me at this point in time.
I know a little bit about this subject, but I could always use some
help, so if you can help me please do so. Email me back with your
ideas and thoughts of this matter.
Thank you and I greatly appreciate it.
Michael
- 5
- Servlet-to-JSP using Tomcat 4.1Im running Tomcat 4.1 with JDK 1.4.2 on Win XP SP1
I have made a simple database search page (using MSAccess) that fetches
records using jdbc odbc drivers.
A servlet does the database processing, puts the finished search results
into a vector (each result is represented by a javabean) and i use the
following code in doPost():
session.setAttribute("results",l_vecTmp); // l_vecTmp is the vector
ServletConfig sc=getServletConfig();
ServletContext sx=sc.getServletContext();
RequestDispatcher rd=sx.getRequestDispatcher("/results.jsp");
rd.forward(req, res); //the 2 params are the standard httpservlet request
and response objects that were passed to the servlet
In the JSP, I use the following code:
<%! int i;
Vector l_vecTmp;%>
<%! SearchResultBean l_srb;
int l_iSize=l_vecTmp.size(); %>
<% try
{
l_vecTmp=(Vector)request.getAttribute("results");
}
catch(Exception e)
{
e.printStackTrace();
}
%>
The directory structure is as follows-
Location of results.jsp:
<tomcat-root>\webapps\studentsearch
Location of servlet:
<tomcat-root>\webapps\studentsearch\WEB-INF\classes
When I run the application, I get a JasperException in the servlet, at the
requestdispatcher line.
Does it mean the servlet cant find the JSP?
Do i have to add the JSP to the web.xml deployment descriptor?
ANy help appreciated
Rex
- 6
- 7
- retrieving CPU Usage and Memory Usage information in JAVAHi All,
I 've been searching through this group for information on CPU and
Memory usage retrieval on Windows machine using JAVA. After following
so many previous threads on the same subject, the possible solution I
've observed was using JNI calls to native libraries for these OS
specific information retrieval.
Later I found that java management libraries already has it, native
libraries and some jmx classes.
Sharing the code, hope this may help group members in their
requirements.
Code:
com.sun.management.OperatingSystemMXBean mxbean =
(com.sun.management.OperatingSystemMXBean)
ManagementFactory.getOperatingSystemMXBean();
System.out.println("********* CPU & MEMORY USAGE OF \\harsh
*********");
System.out.println("OS : "+mxbean.getName());
System.out.println("Available Processors :
"+mxbean.getAvailableProcessors());
System.out.println("Commited Virtual Memory :
"+mxbean.getCommittedVirtualMemorySize());
System.out.println("Free Physical Memory :
"+mxbean.getFreePhysicalMemorySize());
System.out.println("Free Swap Space Size :
"+mxbean.getFreeSwapSpaceSize());
System.out.println("Process CPU Time : "+mxbean.getProcessCpuTime());
System.out.println("Total Physical Memory Size :
"+mxbean.getTotalPhysicalMemorySize());
System.out.println("Total Swap Space Size :
"+mxbean.getTotalSwapSpaceSize());
Problem:
getProcessCpuTime() method returns the CPU time used by the process on
which the Java virtual machine is running NOT the '%CPU Usage' time
which i was hoping to get.
If anyone is having idea about how to obtain '%CPU Usage' of windows
machine using java program, kindly post the message.
Regards,
- 8
- JDBC QuestioComing from the world of VisualBasic, I'm not find Java too hard to catch on
to. After just a couple of weeks of real coding, I'm even cranking out some
code to access a MySQL database. I've got something of a conceptual hill to
jump over, and that's about the Statement class. In VB, I'm used to using
ADO, and just opening a connection and then running queries against it
(either record sets or update-style queries). Is it just the case that any
code I'm translating I just need to insert the lines dealing with the
Statement class, and that's it? What is the purpose of Statement?
--
Aaron Clausen
email***@***.com
- 9
- null pointer at run timeWhen I run my program the first time, the cookie must be a null.
So, for the following statement, why I will get null pointer exception at
runtime? How can I fix it?
if(cookie.getValue()!=null){
...
}else{
...
}
Thanks
- 10
- IBM human resources may be stealing from youIf you are a minority at IBM check your credit cards carefully, IBM human
resources may be stealing from you. I found $370 of charges on my card, it
was done by human resources and it took me 5 months to get it back
- 11
- JTable Header / CustomHi,
I'd like to change the L&F of the JTable Header but I'm not sure how to do
this.
Basically, I want the header columns to look flat instead of raised, with a
custom background color.
Thanks for any Tips.
WT-
- 12
- How to let a user put objects in a scene?x-no-archive: yes
Hello, all.
I'm about to write a 3D-editor for neuronal morphologies.
Picking in existing morphologies works, now I'm trying to get it
to enable an user to interactively create and place new objects
in the scene, thus building new models from scratch.
When clicking at the Canvas3D, I receive 2D-coordinates, as expected.
But for placing a new object, I'd obviously need 3D-coordinates.
Is there any way for me to have the objects appear at a "somehow
reasonable" depth regarding any existing morphology? It does not
necessarily have to be the exactly correct placement, since the user
will be able to adjust it after it has been created.
But in most cases one will of course want to add a new object close
to an other.
I could imagine to create any new object in a given distance to
the near clipping plane (or just half the distance 'tween the near
clipping plane and the model itself) as a quick hack.
Is there any better way to solve this?
Can one somehow determine the SGO that is closest to where the
MouseEvent occurs /without/ picking? Picking (of course) only works
when clicking on SGOs that are already present.
In my case, I'd have to calculate some position in 3-space without
the picking engine, since I've got nothing to click on, but the raw
Canvas3D.
Thanks in advance for any answers.
Regards,
Andr?
- 13
- Embedded DB or XML storage optionsHi,
We are trying to determine what is the best storage method for our
application. We are partial to XML and would prefer a solution based on
this format.
Or maybe going from an RDBMS, like this one:
http://hsqldb.sourceforge.net/ to XML (through a Save operation or
Export) is a better choice for speed? (storing XML data on the fly is
probably slower then RDBMS?).
Any suggestions would be appreciated.
Thanks,
-Justin
- 14
- Problem with RMI in LinuxI'm a newbie in the RMI programation.
I downloaded the sample code in Java tutorial in java.sun.com and
tried to compiled it. First, I compiled the interface class and was
going to compile the stub and skeleton. However, after typing "rmic -d
. engine.ComputeEngine" the following exception appeared:
ComputeEngine_Stub.java:40: error:Syntax error: found '{'
java.lang.Exception: exited with errorcode 1
at java.lang.Throwable.fillInStackTrace(Throwable.java:native)
at java.lang.Throwable.<init>(Throwable.java:38)
at java.lang.Exception.<init>(Exception.java:24)
at kaffe.tools.compiler.Compiler_kjc.compile(Compiler_kjc.java:53) at
kaffe.rmi.rmic.RMIC.compile(RMIC.java:828)
at kaffe.rmi.rmic.RMIC.processClass(RMIC.java:91) at
kaffe.rmi.rmic.RMIC.run(RMIC.java:74) at
kaffe.rmi.rmic.RMIC.main(RMIC.java:53)
I'm working with the lastest version of jdk for Linux.
Can you help me please??????
- 15
- Fixing and Continuing feature for Java IDE?I read that NetBean have it, I try simple main code:
public static void main(String[] args) {
// TODO code application logic here
int a=3;
a=9; <<<<<<<
}
I try to change the Value assignment to "a" at last line. and I realize
that no way to execute this line again. in short no way to step
reverse. so for this cases we need to change current value in watches
window and change the source code for next run. it's true?
but what we can do if have a complicate algorithm and have fix with
some parameters, how we suppost to use with this featurse?
I read about stack call, but I try this code:
static int aa(){
return 6;
}
public static void main(String[] args) {
// TODO code application logic here
int a=3;
a=9;
a=aa();
a=5;
}
but the call stack on run menu stil grayed and not available. and bad
from this, the debugger point to wrong line when i step into aa()
function?
Have some one to help? or have another group for NeBean
Maybe have some another IDE with this feature?
thanks
|
|
|