seam

Disabling seam's redirect filter

僤鯓⒐⒋嵵緔 提交于 2019-12-05 23:17:42
问题 I'm doing a project in seam that requires restful URLs. I have a view that is mapped to /group/{group}/{locale}. On that page I have a list of so called messages. Each message has a button to save changes to the message. This is linked to an action bean like this: <h:commandButton type="submit" value="Save Changes" action="#{groupAction.update}" /> Each message has an anchor, so /group/{group}/{locale}#{id} can be used to make the browser go to that anchor. This is why I need a redirect after

h:selectOneRadio containing images

二次信任 提交于 2019-12-05 18:43:32
I have a h:selectOneRadio tag for displaying a number of radiobuttons: <h:selectOneRadio value="#{myBean.radioButtonSelection}"> <s:selectItems value="#{myBean.getPossibleRadioButtonSelections()}" var="rs" label="#{rs.toString}"/> </h:selectOneRadio> Now, instead of radiobuttons with string values (labels), I would like to have radio buttons with (clickable) images next to it. Is this possible? If so, how? Update: Actually, there should be both text, and an image with a question mark which shows a modal panel when clicked on it. You can use <h:outputLabel for="form:radioGroupId:X"> and place a

How can I call a JavaScript function after every a4j AJAX response?

不问归期 提交于 2019-12-05 16:25:34
I am working on a web app using JSF w/Seam. I want to be able to call a JavaScript function after every ajax response. I'm looking for a way to do this without putting an oncomplete attribute on every commandLink/commandButton on every page. I think there's a way to set up a servlet filter (interceptor? I get the terms confused) to inject the JS call into each response. I'm going to look into that. In the meantime, if anyone has any other suggestions, I'm all ears. EDIT: I think the jQuery ajaxSuccess method might be the way to go here, but I'm not sure how to actually use it. I can't get

JSF/Seam: How to download and print a dynamically generated PDF file without user intervention?

蹲街弑〆低调 提交于 2019-12-05 14:55:39
I have a JSF/Seam web app which has a page with a form which, when submitted (button clicked), causes a PDF file to be dynamically created (in Java, server side) based on the form input. Currently what I have working is that the resulting PDF is returned to the browser as a file download, so the user can opt to save it or open it in Acrobat Reader for subsequent printing. What I would like to happen is that the PDF is sent to the browser and printed (client side) without further user intervention (well, other than perhaps the Windows printer options dialog appearing, about which there's

EL variable in JSF ResourceBundle

主宰稳场 提交于 2019-12-05 11:27:13
i read somewhere (don't find it anymore) that i can use EL Expresions in the resource bundle and then use it without changes in *.xhtml files. some.text=#{someBean.stepsLeft} more to switch the position of the variable in different languages. But actually it wont work. I can use Interpolator class to handle the parsing or add some.text.before some.text.after and let one of them empty. I would prefer it to use it without interpolator.interpolate() if possible. JSF resourcebundles does by default not resolve EL. It however by default supports MessageFormat API in combination with <h:outputFormat

a different object with the same identifier value was already associated with the session when trying to persist entity

只谈情不闲聊 提交于 2019-12-05 10:58:25
I have a slight problem that I don't know how to solve. Could you help me please? When I am trying to persist entity I get next exception: 12:47:39,398 ERROR [org.black.dmitriy.entityHome.ScheduleHome] (http--127.0.0.1-8080-1) javax.persistence.EntityExistsException: a different object with the same identifier value was already associated with the session: [org.black.dmitriy.entity.Schedule#1] at org.hibernate.ejb.AbstractEntityManagerImpl.convert(AbstractEntityManagerImpl.java:1333) [hibernate-entitymanager-4.0.1.Final.jar:4.0.1.Final] at org.hibernate.ejb.AbstractEntityManagerImpl.convert

Is it possible to use Seam in a JBoss timed service?

天涯浪子 提交于 2019-12-05 02:44:45
问题 I've started to write some new JBoss timed service that was meant to use some existing seam components. But it seems that I can't access these components because of non-existing contexts. Is it possible to use them other than in the typical situation with JSF? A little snippet to demonstrate what I want to do... @Service public class MyService extends DefaultTimedService implements TimedObject, DefaultServiceInterface { @Timeout public void ejbTimeout(Timer timer) { MyInterface loader =

Manual Transactions with Seam POJO

半腔热情 提交于 2019-12-05 00:30:40
问题 What is best practice for using Database Transactions with Seam when not using EJBs - ie. when deploying Seam as a WAR? By default Seam JavaBeans support Transactions. I can annotate a method with @Transactional and that will ensure that a transaction is required. Or I can use @Transactional(NEVER) or @Transactional(MANDATORY). What I can't find out how to do is to create my own Transaction, set a timeout, begin and then commit/rollback. I have tried using: UserTransaction utx = Transaction

CDI lifecycle of bean, @Inject and params

荒凉一梦 提交于 2019-12-04 22:02:32
The view and bean were working until I tried to fix non-standard names, and I've now broken the connection between the two. Oddly, the "back" button has the correct link, but content just doesn't show, nor log. Why doesn't Detail.getComments() execute? I've been going through the weld docs and trying to better understand @Inject. There seems to be a lifecycle problem which I don't understand, either. If it's not lifecycle, then I cannot even speculate as to why Detail.getComments() never shows in the glassfish logs: INFO: MessageBean.getModel.. INFO: SingletonNNTP.returning messages.. INFO:

Seam in JSF 2.2 causes java.lang.NullPointerException at com.sun.faces.application.NavigationHandlerImpl.determineViewFromActionOutcome

和自甴很熟 提交于 2019-12-04 18:40:39
I am trying to run my application on WildFly8.2, which was build by using Jboss 5.1.I migrated my entire application and able to see the login page. But while navigating to JSF pages, it is throwing the below exception. My old application is build on JSF 1.2 2015-07-15 14:49:02,108 INFO [javax.enterprise.resource.webcontainer.jsf.config] (MSC service thread 1-1) Initializing Mojarra 2.2.8-jbossorg-1 20140822-1131 for context '/booking' 2015-07-15 14:49:03,303 INFO [org.wildfly.extension.undertow] (MSC service thread 1-1) JBAS017534: Registered web context: /booking 2015-07-15 14:49:03,402 INFO