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

Gerbrand van Dieijen

Ranch Hand
+ Follow
since Nov 28, 2008
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 Gerbrand van Dieijen

David Serio wrote:
Not working:




As stated in the javadoc on JTable
the addColumn method has void return type.
So a corect syntax could be:

11 years ago
Thanks for the tip, that framework looks easy to use.
11 years ago
Alternatively, you could use the a4j:poll tag. That tag will periodically poll the server, and can then update another a4j region or component. In this case, you could update the area that displays if a user is in his shift or not.

To prevent to many polls, you could set the interval to the total time the user has left before his shifts ends.

See: http://docs.jboss.org/richfaces/3.3.2.GA/en/devguide/html/a4j_poll.html
11 years ago
JSF
I found Exe4j work very well, to turn start java application as executable: http://www.ej-technologies.com/products/exe4j/overview.html

Saved me the trouble that I had with batch files or executable jar files, while still having a lot of flexibility:

- Exe4j automatically detects if the user has Java installed. If not, a the user is given the option to go to javasoft.com and download & install a vm
- Exe4j can handle multiple installed vm's. You can optionally specify what version your software needs (java 1.5, java 1.6, any version, etc.)

11 years ago
Hello,

There's an external webform out of my control that can be used to access and modify data. I want to access that webform automatically, as if it is a webservice.

All objections aside (what to do when the webform changes, why isn't there an webinterface in the first place, ec.), what is a good tool to do that?
My first guess is apache.commons.http library would be able to do that, allthough that requires some manual work. Are there any other tools (commercial or open-source/free) that allows to do that?

Are there any other people who're doing that, accessing external webforms to automatically perform actions? Any tips?
11 years ago
Hello,

You could modify the getDefaultShipmentMethods method, to return
selectItems whose value is shomething like a ShipmentMethod bean (Object), rather then a shipmentMethodCodeId. The ShipmentMethod bean can contain a property (via something like getName) name, that contains the name besides a property shipmentMethodCodeId. That way you'll have access to both.

Then you have to add a property customerSession.customer.defaultShipmentMethod of type ShipmentMethod to your customerSessoin.customer bean.

Something like (not checked for syntax errors btw):

11 years ago
JSF
The location-URL in the WSDL itself doesn't matter - as the real url where you connect to can be set programmatically in the client-API you use. You can try this out with SoapUI also.
11 years ago

Amardeep Salkar wrote:

Gerbrand van Dieijen wrote:I'm not entirely sure about your problem. Do you have a java application, that is executed by running a class with a main method? The JVM will then be terminated when the main method exists and there's no other (non deamon) thread running.
To clarify: if you open a Swing or AWT window, there will always be an extra running thread, as Swing or AWT will spawn one seperate thread (to handle events and do graphic updates).

If your program exists, this is probably because it has finished doing everything it has to do.




Dear Gerbrand,

I've one Application which contain java main i.e. p.s.v.main() that I've made one executable jar file through Jar2Exe. and when I run that Application it is running fine, also I'm able to task manager that application is running using my computer name. but when I log off from my account, that process is also killed. I don't want that. What I want that process will run if I logged off.

Hope, you may me out of this issue.


Regards,
Amardeep



By Logging off, do you mean logging off Windows ? In that case, as told in the other postings, you have to install your application as a windows service. Creating a windows service is not as hard as it may seem.
See Google for a start:
http://www.google.nl/search?q=install+java+service

Basically, the java application is wrapped and then available as a service. That service will become active when Windows starts (not when you login). You'll be able to see an overview of currently installed services at:
Configuration screen, Administrative Tools, Services.


I'm not entirely sure about your problem. Do you have a java application, that is executed by running a class with a main method? The JVM will then be terminated when the main method exists and there's no other (non deamon) thread running.
To clarify: if you open a Swing or AWT window, there will always be an extra running thread, as Swing or AWT will spawn one seperate thread (to handle events and do graphic updates).

If your program exists, this is probably because it has finished doing everything it has to do.
With a4j library you could do that: http://www.jboss.org/community/wiki/Ajax4jsf

Something like:



The event parameter is the javascript event that will cause the method specified by action to be executed. Instead of onclick, you could also use onsubmit, onload, onchange, etc. depending on the jsf-component in which you've embedded the a4j:support section
setNeedToPrintToFalse works as the name suggests. The reRender value lists all id's of jsf components, areas or forms that need to be rererended after the javascript event fired.

12 years ago
JSF
I've used Nullsoft-Installer (NSIS) a while ago and found it quite easy to use as well as flexible: http://nsis.sourceforge.net/Main_Page
The NSIS can create windows installation files only, however, there are numerous configuration examples to create installers for java application as well (that can optionally install a JRE).
For users of other operations, you could just package your application as zip or .tar.gz and include a .sh file to start the file. Depends on the need of those users - most Linux users rather hav the flexibility of a .tar.gz that you can just unpack then an installer file that installs in either the home directory or /opt.

Alternatively you could also use java webstart. Java webstart will also give you the advantage your application can update itself automatically.
12 years ago
You can accomplish that with ajax. Ajax4jsf is an easy to use library for JSF, that allows you to execute (server-side) java code when a javascript event occurs (such as onchange, onclick, etc.) and rerender part of the browser-view. Technically, still a server-call is made, but since the only a portion of the browser-view is redrawn, the effect is the same as you would have with client-side javascript only.
Ajax4jsf is integrated with the jsf library richfaces, but can be used apart from richfaces too.
The richfaces library has also a few controls such as togglepanel and jtree that can render part of the content completely client-side, so that for example no server-call is needed when the user switches a panel or opens a tree-item.

See: Richfaces developer guide and Ajax4jsf
12 years ago
JSF
I agree to a certain extend. Being analytical, curious, and having a good solid understanding of computer theory are important to be in software industry.
However, knowing the trends in technologies, what is hot and what not can (JSF, GWT, Ruby, Scala, Wicket, Spring, SOAP, etc.) can indicate you're a good candidate for a software developer, same goes for trends in project management (scrum, agile, xp, RUP) if you want to do more management. Most important thing is probably not *knowing* all these technologies and trends, but being able to *value* them, to say what each of them makes them different or just all the same.
12 years ago

sujith Acharya wrote:



Minor note: the above code is not thread save. So in case you're accessing getObject from multiple threads (which usually happens when used within a webapplication) you'll need to add the synchronized keyword:



Else you'll might get more objects than wanted, if getObject gets executed at exactly the same time.
12 years ago
The f:param tags works serverside, while javascripts works client side.

You can use ajax to accomplish that. You can use a library such as ajax4j (part of richfaces) to have ajax support for JSF 1.2 - if you use JSF 2.0 (very new, so not very likely) you'll have ajax support by default.

Using ajax4j, you can (amongst others) bind javascript events to serverside methods:


myPanelId refers to an ajax4j region that should be rerendered.

See documentation on ajax4j website, and the many examples on the web for more information.
12 years ago
JSF