Brendan Healey

Ranch Hand
+ Follow
since May 12, 2009
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
12
Received in last 30 days
0
Total given
1
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Brendan Healey


If the image is not within the deployed project directory structure then you need to use a servlet like this:
http://balusc.blogspot.co.uk/2007/04/imageservlet.html

11 years ago
JSF

You need to post up some code, there's too much left to the imagination here. Are you using @ManagedProperty? and if so
has the property got a setter method?

Regards,
Brendan.
11 years ago
JSF

I just use ? icons with dialog boxes. I prefer to use jquery ui dialogs rather than anything provided by a component library
http://jqueryui.com/demos/dialog/.

Regards,
Brendan.
11 years ago
JSF

Fair point, the web tier section should be ok for you. Glassfish is the EE 6 reference implementation so it's got everything
in it, JAX-RS, JAX-WS etc... and I can't comment on what specs are supported by WebLogic.
11 years ago
JSF

The tutorial is JSF 1.2 based and JSF 2 has been out for nearly 3 years now, so really I'd suggest starting with the
newer version. I'd say most of the JSF content to be found on the web would be JSF 2 based now. The Java EE 6
tutorial is pretty good: http://docs.oracle.com/javaee/6/tutorial/doc/
11 years ago
JSF

By default JSF uses a jsessionid cookie in preference to URL rewriting. It sounds like your users are somehow connecting to the
same session, are you using @SessionScoped backing beans? Are they connecting up from the same browser or using different
computers? Are cookies enabled on the browsers?
11 years ago
JSF
The problem is that the action method won't know what row is being deleted without the setPropertyActionListener.
I don't know if there's anything new in PF3 to do this but it's how they do it in the showcase.
11 years ago
JSF

> i had a code to clear all the history of my browser

Now that would be a bit of a security nightmare wouldn't it. What is it you are trying to do exactly, do you want a
page or pages to not be cached in the browser cache? you seem to be sending a redirect before setting the response
headers.

Also you don't say where the exception is thrown, or the context in which this code is running, a servlet filter maybe?
11 years ago
JSF
There's a much easier way to do it, you'll be pleased to here.

<h:commandButton id="buttonID1" image="/images//delete.png" style="width:20px" action="#{bean.deleteMethod}">
<f:setPropertyActionListener value="#{var}" target="#{bean.selectedThing}"/>
<p:ajax/>
</h:commandButton>

so just use setProperty... if the dataTable is var="var" and it's displaying a List<Something> then in the bean you
have private Something selectedThing; You could always use p:commandButton although I don't remember if it has an
image attribute (it has icon=), or a p:commandLink with a nested h:graphicImage and lose the child p:ajax tag.

You didn't show what the dataTable value attribute is but I hope this is valid.

Regards,
Brendan.
11 years ago
JSF

In fact, if you're just getting started do you have a pressing reason for using JSF 1.2 such as an employer
requirement? If not it would save you a fair amount of messing about by just using JSF 2. Another benefit
is that you can use a Java EE 6 server.

Regards,
Brendan.
11 years ago
JSF

Please can you edit your post and format the code using the Code button on the toolbar, it's murder trying to make sense
of it at present.

You're using Richfaces 3 I assume from the use of reRender and presumably JSF 1.2. Does the expression language allow
parameters to be passed to action methods in this version? I really can't remember when this was introduced.

action = "#{employeeStateUtil.setNewEmp()}" //model bean

this any better?

action = "#{employeeStateUtil.setNewEmp}" //model bean

Your code excerpts omit the bean scope annotations which could be significant.

Regards,
Brendan.
11 years ago
JSF
Hazarding a guess, you need to look at f:view locale="#{bean.language}" where the language property is
something like "en", "es" or "fr" and you have files like messages_fr.properties and these are supported-locale's
in faces-config.

The bean should be session scoped and you also need to change the locale in the view when the user selects
a new language:



Also it's recommended to use h:selectOneMenu onchange="submit()" to synchronously refresh the page.
11 years ago
JSF

There you go then. Have a good day.
11 years ago
JSF

You're doing a full page submit which is why the message doesn't appear, but something like this should do what you want
(note that you're specifying null as the id in addMessage() so you need h:messages, to get the h:message components to
render you need to give them ids and include them in the render= attribute value of the f:ajax tag):



Regards,
Brendan.
11 years ago
JSF
I can't help you as I don't use primefaces any more. Anyone? (actually this is cross-posted on stackoverflow...)
11 years ago
JSF