Win a copy of Rust Web Development this week in the Other Languages forum!

Johannes Salter

Greenhorn
+ Follow
since May 02, 2010
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Johannes Salter

I'm looking for a easy way to ignore parsing exceptions in a block of Code.
If an exception is encountered the code should just continue in the next line.

Code:Ideas?

Thanks!
11 years ago
Thanks!
How can I combine this with the "standard" automatic JAVA update process?
11 years ago
Howdy!

Is there a way to automatically download JRE / JDK updates and automatically install them?
As far as I see, Sun's integrated updater for the Windows-Platform allows to automatically download the updates, but doesn't install them without user-interaction.

I can do this on Linux by installing JAVA over the package manager. But isn't there a more generic, platform independent...a more JAVA-like solution?
Semms like I'm looking for something similiar like "Windows Update for JAVA".

11 years ago
Howdy!

It seems like I have to write a small JAVA application that burns certain files from a directory to CD.
After burning, I have to check the integrity of the files on CD ( md5sum or similar ).

The program is intended to be run on Windows XP SP 3 ( although it would elegant nice to have a OS-independent solution ).

Is there a way to do this quick and dirty?
Thanks!
11 years ago
Howdy!

I have a short question:

Is it possible to set the login-data for a database you use with JPA at runtime?
As far as I know, you set a preconfigured data-source statically in persistence.xml...

Thanks!

Bear Bibeault wrote:Your method can return anything. The number of elements doesn't matter. It's all just text.


Can I return a list of Strings as text?

PS: First, I want to learn basic JSP and servlet handling. Then I continue with custom tags...
11 years ago
JSP
The problem is, I have a lot of code in my real bean. I don't want to integrate all this Code into my JSP.

I just need to output one or two lines of HTML-code from my bean at the right position.

Expression like <%= don't work here, since I have a variable number of output elements.
11 years ago
JSP
Hi and howdy!

I have a problem in output handling with JSPs.

I want to have an output like:
Text 1
Text 2
Text 3
Text 4

Whereas "Text 1" and "4" come from the JSPand "Text 2" and "3" from a bean.

myText.jsp:myBean.java:The problem is, I get:
Text 2
Text 3
Text 1
Text 4

So the text is always added at the start of the JSP HTML-Code and not within, from where the method is called.

How can I solve this problem?

Is there a more elegant way to solve the problem?

Thanks!
11 years ago
JSP

James Sutherland wrote:In JPA a query with multiple selected values will return a Object[].

Use,
Object[] result = (Object[]) q.setParameter("name", myUserId ).getSingleResult();



You are my hero.
Howdy!

I'm learning Java and database handling, and I'm having problems working with named querys.

Query A:
Query B:

(...)
@NamedQuery(name = "AuthTable.getUserNames", query = "SELECT a.firstName, a.birthName, a.lastName FROM AuthTable a WHERE a.name = :name")})
(...)



I retrieve the information with:When I use the first NamedQuery I can cast "Object result" to "String" and everything goes well.
With the second query JAVA won't let me cast "Object result" to anything. Not to "Array", not to "List", not to anything. "Object result" is useless for me!

When I use "q.getResultList()" I get a list with one element, which equals to "Object result", that is useless for me here too.

Any help appreciated.
Thanks!
Yay!

Working like a charm.
You have my thanks!
11 years ago
JSP

Bear Bibeault wrote:Why do you have anything in the body of the useBean action?

The useBean action tag should be self-closed except in the case where it will enclose setProperty actions to initialize bean properties (itself a rather deprecated practice).



In fact I'm doing some getProperty-Requests in the body.

However...this should be executed every time the JSP is requested.
11 years ago
JSP
Hi!

I'm a JSP starter and encountering a problem I can not understand.

index.jsp:
testClass.java:

I want to impelent an application-wide data storage.

On the first call of my JSP everything works correct. But on any following calls there seem to be problems loading testClass:
Everything between <jsp:useBean ...> and </jsp:useBean> is just ignored ( this is tested ).
No error message is printed in the browser or in the GlassFish logs. I'm just getting my empty page.
What am I missing?

Thanks!!!

11 years ago
JSP