-
1. Re: How to tweak output based on HTTP header for wired/mobil
pmuir Jul 8, 2006 7:06 AM (in response to dbatcn)1. How do I read an HTTP header value that was passed by the client?
I think FacesContext.getCurrentInstance().getExternalContext().getRequestHeaderMap(); will contain this.2. How do I intercept the (partially?) rendered output, tweak it, and send it on its way?
I haven't done this, but perhaps a servlet filter?3. Can Seam (and facelet) XHTML be made to operate nicely *without* the use of javascript?
This was discussed on the facelets list within the last week - I would suggest you take a look, and perhaps follow up there? -
2. Re: How to tweak output based on HTTP header for wired/mobil
gavin.king Jul 10, 2006 12:58 PM (in response to dbatcn)For "tweaking", a servlet filter seems the right approach. Perhaps you might like to take a look at SiteMesh for this kind of work? If so, let me know how well sitemesh integrates with Seam...
I also added this issue, though it is probably not what you want:
http://jira.jboss.com/jira/browse/JBSEAM-299 -
3. Re: How to tweak output based on HTTP header for wired/mobil
dbatcn Jul 10, 2006 4:35 PM (in response to dbatcn)Pete,
Thanks for the hints. Could you please give the URL for the facelets list you mentioned?
Gavin,
I'll look into SiteMesh, thanks. Would it make sense to add the current FacesContext to the FacesApplicationContext or to make it a separately injectable component? Would this be a good way to set response headers too?
Thank you both,
David -
4. Re: How to tweak output based on HTTP header for wired/mobil
gavin.king Jul 10, 2006 4:39 PM (in response to dbatcn)Sorry?
@In FacesContext facesContext
works. -
5. Re: How to tweak output based on HTTP header for wired/mobil
dbatcn Jul 10, 2006 5:24 PM (in response to dbatcn)Yes, you're right. For example in my XHTML file:
User-Agent: <b><h:outputText value="#{facesContext.externalContext.requestHeaderMap['User-Agent']}"/></b>
I think that I was thrown off by looking at the source code instead of taking the right part of the reference manual at face value... ;-) -
6. Re: How to tweak output based on HTTP header for wired/mobil
pmuir Jul 10, 2006 5:34 PM (in response to dbatcn)http://facelets.dev.java.net is the facelets homepage, it's linked off there, nabble carries it, perhaps others.
Gavin et al, this is perhaps something that that should be on the FAQ. In fact, can the FAQ be a wiki page so it is easily editable? Or developed on the wiki or something? -
7. Re: How to tweak output based on HTTP header for wired/mobil
dbatcn Jul 10, 2006 6:58 PM (in response to dbatcn)Putting a little information about this (dependence or lack thereof of javascript) in the Seam documentation area would be very helpful I think, particularly to people like me new to Seam/JSF/facelets/MyFaces/EJB3/JavaPersistence. I think that there's a large population of people like me who are Java-competent who need to create web apps and trying to decide whether to go forward with more recent Java stuff or move (defect?) to Ruby on Rails. Anything that gets people like this going will be hepful. I will admit as a newbie to this that the boundaries between the several projects/APIs I mentioned above are only slowly becoming clear, even with considerable reading from several sources.
-
8. Re: How to tweak output based on HTTP header for wired/mobil
jboss-nth-fan Jul 10, 2006 7:51 PM (in response to dbatcn)"dbatcn" wrote:
Putting a little information about this (dependence or lack thereof of javascript) in the Seam documentation area would be very helpful I think, particularly to people like me new to Seam/JSF/facelets/MyFaces/EJB3/JavaPersistence.
Completly agree, it looks like seam documentation assumes some degree of competency with JSF, EJB (less in v3 due to Pojos but container managed concepts are needed, and other basics).
Maybe a section like: "Things to Know About Underlying Frameworks in Seam" would be a good idea.
In particular Seam has been a breeze for me as I'm very close to JSF, EJB and Java5, but to compete (catch up?) with Rails some minimal background in underlying frameworks is needed, and that could be a consideration for many as you mentioned Java developers.
In regards to your original question, what about creating (or reusing) a pluggable JSF renderer. Something that Seam would be somewhat agnostic to -if not mistaken-
Jsf renderers idea was that in principle: to server different clients.
Yeyo"dbatcn" wrote:
I think that there's a large population of people like me who are Java-competent who need to create web apps and trying to decide whether to go forward with more recent Java stuff or move (defect?) to Ruby on Rails. Anything that gets people like this going will be hepful. I will admit as a newbie to this that the boundaries between the several projects/APIs I mentioned above are only slowly becoming clear, even with considerable reading from several sources.