 |
 |
Index ‹ java-programmer
|
- Previous
- 1
- 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
- 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
- 1
- (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
- 2
- 3
- 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...
- 4
- 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...
- 6
- 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
- 8
- 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-
- 9
- 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??????
- 11
- 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,
- 13
- byte data typehello,
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
- 14
- 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
- 14
- 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
- 16
- 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
- 16
- 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
|
| Author |
Message |
jaj_developer@yahoo.co.uk

|
Posted: 2005-4-6 16:39:00 |
Top |
java-programmer, Hotkeys question
All,
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
|
| |
|
| |
 |
Arnaud Berger

|
Posted: 2005-4-6 16:46:00 |
Top |
java-programmer >> Hotkeys question
Hi,
You may want to deal with addKeyListener(KeyListener kl) method of
class java.awt.Component (also in JComponent).
The javadoc for KeyEvent should help you a lot also.
Regards,
Arnaud
<email***@***.com> a 閏rit dans le message news:
email***@***.com...
> All,
>
> 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
>
|
| |
|
| |
 |
jaj_developer@yahoo.co.uk

|
Posted: 2005-4-6 17:10:00 |
Top |
java-programmer >> Hotkeys question
Arnaud,
Thats the way it currently is - and it doesn't function the way it
should.
Thanks for you advice though,
Jaj
|
| |
|
| |
 |
Arnaud Berger

|
Posted: 2005-4-6 17:19:00 |
Top |
java-programmer >> Hotkeys question
Hi,
Could you please post the code you have so far ?
Regards,
Arnaud
<email***@***.com> a 閏rit dans le message news:
email***@***.com...
> Arnaud,
>
> Thats the way it currently is - and it doesn't function the way it
> should.
>
> Thanks for you advice though,
>
> Jaj
>
|
| |
|
| |
 |
jaj_developer@yahoo.co.uk

|
Posted: 2005-4-6 18:18:00 |
Top |
java-programmer >> Hotkeys question
I don't have any - the reason I am asking here is 'cause I can see two
ways of doing this:-
1) Grab a java file (GPL) that has been written to do the setting up of
hotkeys
2) Write it myself.....
As such I'd like to go for option 1 ;-]
Jaj
|
| |
|
| |
 |
Arnaud Berger

|
Posted: 2005-4-6 18:56:00 |
Top |
java-programmer >> Hotkeys question
This little attempt may help you :
public class KeyAdapt extends KeyAdapter{
public void keyPressed(KeyEvent e) {
System.out.println("key pressed , keychar: "+(char)(e.getKeyCode()));
System.out.println("Ctrl ? : "+e.isControlDown());
System.out.println("Alt ? : "+e.isAltDown());
System.out.println("Shift ? : "+e.isShiftDown());
System.out.println("All modifiers :
"+e.getKeyModifiersText(e.getModifiers()));
}
}
This class is also a KeyListener.
So just create your JTextField/Area and do
addKeyListener(new KeyAdapt());
Please note that this will get many events while a key is pressed (as of the
usual key repetition when
a key remains pressed)
So you may have to filter to avoid printing many times the "same" event .
That's up to you.
Cheers,
Arnaud
<email***@***.com> a 閏rit dans le message news:
email***@***.com...
> I don't have any - the reason I am asking here is 'cause I can see two
> ways of doing this:-
> 1) Grab a java file (GPL) that has been written to do the setting up of
> hotkeys
> 2) Write it myself.....
>
> As such I'd like to go for option 1 ;-]
>
> Jaj
>
|
| |
|
| |
 |
jaj_developer@yahoo.co.uk

|
Posted: 2005-4-6 19:08:00 |
Top |
java-programmer >> Hotkeys question
thxs
Jaj
|
| |
|
| |
 |
| |
 |
Index ‹ java-programmer |
- Next
- 1
- Serial Port Communication errorHi,
I have one customer (out of ~100) that can't get his communication over
the Serial port to work and I don't know how to find why this fails. The
customer can use the serial port to transfer data to other programs.
Any ideas?
Maybe it can be checked/verified in WinXP?
Can I add more exceptions to catch the fault?
Magnus
--- code ---
public UploadCommunication(String pID) { // Constr
try {
Format formatter = new SimpleDateFormat("yyMMdd-HHmmss");
LOGFILE = "UploadLog"+formatter.format(new Date())+".txt";
TimeStamp = new java.util.Date().toString();
Logg.ULLog(TimeStamp, LOGFILE);
Enumeration a = CommPortIdentifier.getPortIdentifiers();
if (!a.hasMoreElements()) {
Logg.ULLog("No ports found!", LOGFILE);
boolean stopRead = true;
}
portID = CommPortIdentifier.getPortIdentifier(pID);
serialPort1 = (SerialPort) portID.open("UploadCommunication",
2000);
Logg.ULLog(portID.getName() + " opened for instrument
input",LOGFILE);
} catch (Exception ee) {
if (portID == null) {
Logg.ULLog("PortID is NULL for port: " + pID,LOGFILE);
} else {
Logg.ULLog("main catch portID: " + portID, LOGFILE);
}
Logg.ULLog("main catch ee: " + ee.toString(),LOGFILE);
boolean stopRead = true;
try {serialPort1.close();
} catch (Exception ce) {} //try to close the port
}
--- end code ---
--- I get the following in UploadLog ---
Mon Dec 5 14:45:09 GMT-05:00 2005
No ports found!
PortID is NULL for port: COM1
main catch ee: javax.comm.NoSuchPortException
- 2
- Accessing cvs from a java applicationHi all,
I am writing a small image processing application using java. All of
my image data is currently stored in a cvs repository so the java
application needs to be able to checkout files from the repository and
then check them back in when done with the processing.
Any suggestions on the easiest way to do this? (Hopefully with an
example somewhere ;-) I spent a little while searching the newsgroups
but there is a lot of conflicting info out there.
Thanks,
Stu
email***@***.com
- 3
- 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
- 4
- Never mind - Re: Glassfish/Netbeans 6 no messages in output windowNever mind. The output window has mysteriously started working.
After days of researching, reconfiguring, reinstalling etc and it not
working, it has suddenly started working. I guess all I needed to do was
post this message and voila problem solved!
"wizard of oz" <email***@***.com> wrote in message
news:bInvj.17765$email***@***.com...
> Hi all,
>
> I've recently set up the NetBeans 6 J2EE bundle and have successfully got
> an MDB + client app working.
>
> I like to print System.out.println statements into my code, however they
> do not appear in the Netbeans output window (in fact nothing does). This
> is the window that opens when you run the project or select "view server
> log" from the Services tab in the IDE.
>
> The messages do appear in the log file - but they are mixed in with a
> whole bunch of other messages that are of no interest too me.
>
> How can I get my messages from my Glassfish web app and my MDB to appear
> in the NetBeans output window?
>
> TIA
>
>
- 5
- Announcement: Release of (X)Emacs CC Mode 5.31Release Announcement
CC Mode Version 5.31
Martin Stjernholm, Alan Mackenzie
This message announces the availability of a new version of CC Mode,
an Emacs and XEmacs mode for editing C (ANSI and K&R), C++,
Objective-C, Java, CORBA's IDL, Pike and AWK code.
A list of user visible changes is detailed in the NEWS file and in the
URL listed below. More information, including links to download the
source, are available on the CC Mode web page:
<http://cc-mode.sourceforge.net/>
Send email correspondence to
email***@***.com
For a list of changes please see
<http://cc-mode.sourceforge.net/changes-531.php>
--
Alan Mackenzie (Munich, Germany)
Email: email***@***.com; to decode, wherever there is a repeated letter
(like "aa"), remove half of them (leaving, say, "a").
- 6
- HttpUnit throws java.lang.NoSuchMethodError as soon as I attempt to create a WebConversation.On 14 Aug 2003 02:14:33 -0700, email***@***.com (thomas) two-finger
typed:
>I installed HttpUnit as described.
>
>Apparently if both tidy.jar & nekohtml.jar are in the CLASSPATH the
>application fails with the following Exception (see sniplet)...
>
>Can someone confirm & indicate WHY ?
Normally, you would need the source code of NekoDOMParser to be able to see
what is going on exactly.
But I think that the version of nekohtml.jar you are using requires a
specific minimum version of either the servlet engine, the JDK, or perhaps
another library it needs and is available in an older version only.
What is happening here, is that NekoDOMParser is using a method in a class
that does not exist in the actual class you have on your system.
Example:
JDK 1.02 would throw the same error on Button.addActionListener(), because
it did not have the listener system implemented yet.
JDK 1.1 would run it fine, however.
So: check your requirements for that library.
>
>Tia,
>
>\T,
>
>
><snip>
>java.lang.NoSuchMethodError
> at com.meterware.httpunit.parsing.NekoDOMParser.<init>(NekoDOMParser.java:113)
> at com.meterware.httpunit.parsing.NekoDOMParser.newParser(NekoDOMParser.java:65)
> at com.meterware.httpunit.parsing.NekoHTMLParser.parse(NekoHTMLParser.java:40)
> at com.meterware.httpunit.HTMLPage.parse(HTMLPage.java:244)
> at com.meterware.httpunit.WebResponse.getReceivedPage(WebResponse.java:975)
> at com.meterware.httpunit.WebResponse$Scriptable.load(WebResponse.java:577)
> at com.meterware.httpunit.javascript.JavaScript$Window.initialize(JavaScript..java:419)
> at com.meterware.httpunit.javascript.JavaScript.run(JavaScript.java:80)
> at com.meterware.httpunit.javascript.JavaScriptEngineFactory.associate(JavaScriptEngineFactory.java:46)
> at com.meterware.httpunit.FrameHolder.<init>(FrameHolder.java:44)
> at com.meterware.httpunit.WebWindow.<init>(WebWindow.java:218)
> at com.meterware.httpunit.WebClient.<init>(WebClient.java:51)
> at com.meterware.httpunit.WebConversation.<init>(WebConversation.java:46)
> at com.<manually_removed>.servlets.home.TestLoginServlet.testCreateConversation(TestLoginServlet.java:71)
> at java.lang.reflect.Method.invoke(Native Method)
> at junit.framework.TestCase.runTest(TestCase.java:166)
> at junit.framework.TestCase.runBare(TestCase.java:140)
> at junit.framework.TestResult$1.protect(TestResult.java:106)
> at junit.framework.TestResult.runProtected(TestResult.java:124)
> at junit.framework.TestResult.run(TestResult.java:109)
> at junit.framework.TestCase.run(TestCase.java:131)
> at junit.framework.TestSuite.runTest(TestSuite.java:173)
> at junit.framework.TestSuite.run(TestSuite.java:168)
> at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:202)
> at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:116)
> at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:68)
></snip>
- 7
- How to create an object of a given class NAME?I got the following piece of code:
static private Idiom determineIdiom(Locale region) {
if (region==null) region=DEFAULT_REGION;
String language=region.getLanguage();
if (language==null) language=DEFAULT_LENGUAJE;
Idiom myIdiom=null;
if (language.equals("es")) { myIdiom=(Idiom)new
Idiom_es();
} else if (language.equals("en")) { myIdiom=(Idiom)new
Idiom_en();
} else if (language.equals("ca")) { myIdiom=(Idiom)new
Idiom_ca();
} else if (language.equals("fr")) { myIdiom=(Idiom)new
Idiom_fr();
} else {
myIdiom=(Idiom)new Idiom_es(); //default
}
return myIdiom;
}
All the Idiom_* classes extend Idiom, which in turn implements an
interface. If I want to add support for a new language (say, finnish),
I
have to write a Idiom_fi class AND I have to put a new if sentence in
this method:
} else if (language.equals("fi")) { myIdiom=(Idiom)new
Idiom_fi();
I'd like to get rid of the second requirement, and for that I'd need to
be able to
compose the name of the class I want to instance, sorta like this:
myIdiom=(Idiom)new {{"Idiom_"+language}}();
I'm not sure if this can be done in Java. Can it?
Thanks in advance.
- 8
- 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
- 9
- Quick question on polymorphism and instanceofPlease consider:
===================
public class ClassA {
public void someMethod(ClassB objB) {
//...
}
}
===================
public class ClassB {
}
===================
public class SubClassB extends ClassB {
}
===================
public class Main {
private static class SubClassA extends ClassA {
public void someMethod(ClassB objB) {
if (objB instanceof SubClassB) { //<------ see question
below
//...
} else {
super.someMethod(objB);
}
}
}
private ClassA objA = new SubClassA();
public ClassA getClassA() {
return objA;
}
}
====================
Question: Can I avoid the use of the "instanceof" operator, if yes how?
With thanks,
Willie
- 10
- 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
- 11
- static hashtable with conent?Did not find out the answer after some google:
how can we create a static hashtable with some initial values there?
static Hashtable ht = new Hasthable();
will only create a empty one. Suppose I want to put some Integer
values as keys and values of this hashtable, how can I do that?
The reason for it is that I am writing a "utility" class, with all the
functions as static. These functions will need to check a fixed
hashtable for some operations.
Thanks a lot. :-)
- 12
- tomcat 5 and apacheHi all;
Can anyone point me to the documentation for getting Tomcat 5 to work with
Apache? I have just gotten Tomact running on my test server (RH Linux 7.3),
Apache's there also. I Can't find the Docs on the jakarta site. The links
that come with tomcat point to the download page. All the documentation I
can find is about Tomcat 4. Is Tomcat 5 too new to use? Am I losing my
mind? Perhaps.
- 13
- 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?
- 14
- ImageIO have problem of reading PNG?I get the following exception, do I need another library to read PNG?
=====File=====
/var/www/html/meaningful/wise/Life_is_pain.png
=====StackTrace=====
java.lang.IllegalArgumentException: Unknown image type 0
at java.awt.image.BufferedImage.<init>(BufferedImage.java:492)
at hk.com.carfield.util.ImageUtil.scaleImage(ImageUtil.java:48)
at hk.com.carfield.item.FileItem.getThumbnail(FileItem.java:47)
- 15
- Anand clique tributes Legendary Chicago GPjAnand clique. - Live at the Thirsty Whale - IN STORES THIS HALLOWEEN
The Award winning Tribal Rock group Anand clique releases Live recordings from the Legendary Thirsty Whale in Chicago - a "put to rest" venue that housed great acts such as the Blue Oyster Cult, Kansas, Skid Row, Guns N' Roses, and many more.
The famous Chicago scene is missed, but not forgotten thanks to Anand clique.
Anand clique. - Live at the Thirsty Whale - AVAILABLE AT ALL RETAIL LOCATIONS THIS HALLOWEEN
also see thirsty whale: metallica, great white, aerosmith, bon jovi, u2, mtv, video, rock music, misfits, danzig, metallica, primus, megadeth, disturbed, korn, limp biskit
sYfawopX3lLCkuTK2F23p7tLbCkfCw8y62hugNhEyynZRQ2HER8nTd1wyg
|
|
|