-
1. Re: Seam component references from custom servlet
stephen May 22, 2008 9:20 PM (in response to dmounday.don.mounday.falcontechnology.com)RTFM: 26.1.4.7. Context management for custom servlets
-
2. Re: Seam component references from custom servlet
dmounday.don.mounday.falcontechnology.com May 22, 2008 10:26 PM (in response to dmounday.don.mounday.falcontechnology.com)Thanks for the reference, but maybe I'm do dull to understand. The following paragraph suggests that the conversationId is supplied in a request parameter by the client.
The context filter expects to find the conversation id of any conversation context in a request parameter named conversationId. You are responsible for ensuring that it gets sent in the request.I don't have any control over the content of the request the client sends to the HttpServlet. Or did I miss-understand the last 2 paragraphs of the section you referenced.
-
3. Re: Seam component references from custom servlet
stephen May 23, 2008 12:25 PM (in response to dmounday.don.mounday.falcontechnology.com)That sentences only relates to the conversation context which of course is not available if you do not tell seam which conversation is active.
To access the application context you only need to make sure that Seam's context filter gets wrapped around you own servlet.
-
4. Re: Seam component references from custom servlet
dmounday.don.mounday.falcontechnology.com May 23, 2008 9:20 PM (in response to dmounday.don.mounday.falcontechnology.com)Stephen
Thanks, I was clearly trying to make this too hard. -
5. Re: Seam component references from custom servlet
metro Jul 21, 2008 11:45 AM (in response to dmounday.don.mounday.falcontechnology.com)I write servlet. I need get access to seam context.
component.xml:
<web:context-filter url-pattern="/x/*" />
web.xml:
<servlet> <servlet-name>My Servlet</servlet-name> <servlet-class>com.x.MyServlet</servlet-class> </servlet> <servlet-mapping> <servlet-name>My Servlet</servlet-name> <url-pattern>/x/multipleUpload</url-pattern> </servlet-mapping>
User.java:
@Entity @Name("logginedUser") @Scope(ScopeType.SESSION) public class User implements Serializable { ... }
MyServlet.java:
public class MyServlet extends HttpServlet { protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { User user = (User) Component.getInstance("logginedUser"); // null AnyAction action = (AnyAction) Component.getInstance("anyAction"); // ok ... } }
LogginedUser exist in session context after login but is not available in my servlet.
If seam component is not entity then i can get it successfully.
Why? How can i get logginedUser from seam context? -
6. Re: Seam component references from custom servlet
metro Aug 1, 2008 12:25 PM (in response to dmounday.don.mounday.falcontechnology.com)It's work OK. I just didn't send JSESSIONID from my flash-application by request.