[JBoss jBPM] - Workflow without DB/Service-Invocations? Is there a simpler
by rainersimon
Hi,
I'm trying to achieve the following goal, and I don't know how to do it in a clever way yet - i.e. without creating a proprietary solution to a problem that someone else has probably solved (better) already:
I'm planning to build a servlet filter that redirects visitors of the same URL to different documents. The redirect-decision should be made based on a decision graph - similar to a workflow graph - and a bunch of parameters stored in the HttpSession context.
I could just hard-code the decision graph into the servlet filter. But I want to be able to change the graph (i.e. the decision logic) without changing the code of the Filter...
I know this should be possible with jBPM. But since there is no interaction with with databases, Web services, or human actors in the decision logic, it seems that I'm following an overly complicated route to achieve a relatively simple goal.
Is there an easier way to do this? Any comments are welcome. At the moment I don't even know what words to Google for ;-)
Thanks,
Ray
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4117043#4117043
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4117043
18 years, 3 months
[JBoss Seam] - FacesContext is null in Identity.initCredentialsFromCookie
by jayliu2000
Hi. I'm working on a seam application (with Seam 2.0 GA) and now I want to use the "rememberMe" feature. The application is deployed to tomcat 6.0 and I'm using myfaces 1.2.
The problem is that the "rememberMe" feature of Seam never works for me and I tried to debug into the codes and fount that when Identity.initCredentialsFromCookie() was invoked, after the first line of this method:
FacesContext ctx = FacesContext.getCurrentInstance();
|
ctx is null.
Can anybody give me some hints?
This is my components.xml:
| <?xml version="1.0" encoding="UTF-8"?>
| <components xmlns="http://jboss.com/products/seam/components"
| xmlns:core="http://jboss.com/products/seam/core"
| xmlns:persistence="http://jboss.com/products/seam/persistence"
| xmlns:transaction="http://jboss.com/products/seam/transaction"
| xmlns:security="http://jboss.com/products/seam/security"
| xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
| xsi:schemaLocation="http://jboss.com/products/seam/core http://jboss.com/products/seam/core-2.0.xsd
| http://jboss.com/products/seam/persistence http://jboss.com/products/seam/persistence-2.0.xsd
| http://jboss.com/products/seam/transaction http://jboss.com/products/seam/transaction-2.0.xsd
| http://jboss.com/products/seam/security http://jboss.com/products/seam/security-2.0.xsd
| http://jboss.com/products/seam/components http://jboss.com/products/seam/components-2.0.xsd">
|
| <core:manager conversation-timeout="120000"
| concurrent-request-timeout="500" conversation-id-parameter="cid" />
| <core:init jndi-pattern="#{ejbName}/local" debug="false" />
|
| <transaction:entity-transaction entity-manager="#{em}" />
|
| <persistence:entity-manager-factory name="myDatabase" />
|
|
| <persistence:managed-persistence-context name="em"
| auto-create="true" entity-manager-factory="#{myDatabase}" />
|
| <security:identity
| authenticate-method="#{authenticator.authenticate}" />
|
| <event type="org.jboss.seam.notLoggedIn">
| <action execute="#{redirect.captureCurrentView}" />
| </event>
|
|
| <event type="org.jboss.seam.postAuthenticate">
| <action execute="#{redirect.returnToCapturedView}" />
| </event>
|
| </components>
|
This is my faces-config.xml:
<?xml version="1.0" encoding="UTF-8"?>
| <faces-config version="1.2" xmlns="http://java.sun.com/xml/ns/javaee"
| xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
| xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-facesconfig_1_2.xsd">
|
| <application>
|
| <view-handler>com.sun.facelets.FaceletViewHandler</view-handler>
| <locale-config>
| <default-locale>en</default-locale>
| <supported-locale>en</supported-locale>
|
| </locale-config>
| </application>
|
|
| </faces-config>
|
This is my web.xml:
| <?xml version="1.0" encoding="UTF-8"?>
| <web-app version="2.5" xmlns="http://java.sun.com/xml/ns/javaee"
| xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
| xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd">
|
| <!-- Seam -->
|
| <listener>
| <listener-class>
| org.jboss.seam.servlet.SeamListener
| </listener-class>
| </listener>
|
| <filter>
| <filter-name>Seam Filter</filter-name>
| <filter-class>org.jboss.seam.servlet.SeamFilter</filter-class>
| </filter>
|
| <filter>
| <filter-name>MyFacesExtensionsFilter</filter-name>
| <filter-class>
| org.apache.myfaces.webapp.filter.ExtensionsFilter
| </filter-class>
| </filter>
| <filter>
| <display-name>Ajax4jsf Filter</display-name>
| <filter-name>ajax4jsf</filter-name>
| <filter-class>org.ajax4jsf.Filter</filter-class>
| </filter>
|
| <filter-mapping>
| <filter-name>ajax4jsf</filter-name>
| <servlet-name>Faces Servlet</servlet-name>
| </filter-mapping>
|
| <!-- extension mapping for adding <script/>, <link/>, and other resource tags to JSF-pages -->
| <filter-mapping>
| <filter-name>MyFacesExtensionsFilter</filter-name>
| <!-- servlet-name must match the name of your javax.faces.webapp.FacesServlet entry -->
| <servlet-name>Faces Servlet</servlet-name>
| </filter-mapping>
|
| <!-- extension mapping for serving page-independent resources (javascript, stylesheets, images, etc.) -->
| <filter-mapping>
| <filter-name>MyFacesExtensionsFilter</filter-name>
| <url-pattern>/faces/myFacesExtensionResource/*</url-pattern>
| </filter-mapping>
|
|
|
| <filter-mapping>
| <filter-name>Seam Filter</filter-name>
| <url-pattern>/*</url-pattern>
| </filter-mapping>
|
| <servlet>
| <servlet-name>Seam Resource Servlet</servlet-name>
| <servlet-class>
| org.jboss.seam.servlet.SeamResourceServlet
| </servlet-class>
| </servlet>
|
| <servlet-mapping>
| <servlet-name>Seam Resource Servlet</servlet-name>
| <url-pattern>/seam/resource/*</url-pattern>
| </servlet-mapping>
|
| <!-- Faces Servlet -->
|
| <servlet>
| <servlet-name>Faces Servlet</servlet-name>
| <servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
| <load-on-startup>1</load-on-startup>
| </servlet>
|
| <servlet-mapping>
| <servlet-name>Faces Servlet</servlet-name>
| <url-pattern>*.seam</url-pattern>
| </servlet-mapping>
|
| <!-- JSF parameters -->
|
| <context-param>
| <param-name>javax.faces.DEFAULT_SUFFIX</param-name>
| <param-value>.jspx</param-value>
| </context-param>
| <context-param>
| <param-name>org.ajax4jsf.VIEW_HANDLERS</param-name>
| <param-value>com.sun.facelets.FaceletViewHandler</param-value>
| </context-param>
| <context-param>
| <param-name>facelets.DEVELOPMENT</param-name>
| <param-value>true</param-value>
| </context-param>
| <context-param>
| <param-name>facelets.LIBRARIES</param-name>
| <param-value>/WEB-INF/tags/mocia.taglib.xml</param-value>
| </context-param>
| <context-param>
| <param-name>
| org.jboss.jbossfaces.WAR_BUNDLES_JSF_IMPL
| </param-name>
| <param-value>true</param-value>
| </context-param>
| <context-param>
| <param-name>org.apache.myfaces.AUTO_SCROLL</param-name>
| <param-value>true</param-value>
|
| </context-param>
| <session-config>
| <session-timeout>10</session-timeout>
| </session-config>
| <welcome-file-list>
| <welcome-file>index.jsp</welcome-file>
| </welcome-file-list>
|
|
| </web-app>
|
Thanks in advance.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4117030#4117030
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4117030
18 years, 3 months