wood burning stoves 2.0*
The moose likes JSF and the fly likes Call to JSF experts Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of JavaScript Promises Essentials this week in the JavaScript forum!
JavaRanch » Java Forums » Java » JSF
Bookmark "Call to JSF experts" Watch "Call to JSF experts" New topic
Author

Call to JSF experts

Pallavi Roy
Ranch Hand

Joined: Jun 01, 2006
Posts: 37
Hi All,
I have included a servlet and JSF portlet in the same war file and deployed on Websphere Portal Server.
But currently the saving of the text area contents into word document is happening but it saves the entire portlet page instead of only the text area contents.I do not understand why my data is not getting printed.Please help me scrutinize this code.

1) JSF Portlet Page:

<h:inputTextarea id="text1" value="#{pc_TextAreaView.textAreaValue}" rows="10" cols="50" />
<h:commandButton id="save1" value="Save with Servlet" action="#{pc_TextAreaView.SaveAsWord}" />

2) Backing bean Save method:


3) Servlet to handle the saving in word document



Break the ice - SCJP 1.4,<br />Where There's a will- SCWCD 1.4.<br />Back in action - Websphere Certified Portal 6 Application Developer
Richard Green
Ranch Hand

Joined: Aug 25, 2005
Posts: 536
<h:inputTextarea id="text1" value="#{pc_TextAreaView.textAreaValue}" rows="10" cols="50" />


ValueBinding vb = facesContext.getApplication().createValueBinding("#{pc_TextAreaView}");
TextAreaView mybean = (TextAreaView) vb.getValue(facesContext);



Shouldn't you get the value of "textAreaValue" from pc_TextAreaView?


MCSD, SCJP, SCWCD, SCBCD, SCJD (in progress - URLybird 1.2.1)
Pallavi Roy
Ranch Hand

Joined: Jun 01, 2006
Posts: 37
Hi,
I have included the following step in my code.
String mytextarea = mybean.getTextAreaValue();

In my managed bean i have TextAreaValue as my property for which i have the setter and getter methods for this property.hence i am retreiving the value.

But there is a strange thing that i have discovered.
The response object which i have forwarded is already having the conetnt of my page embedded in it.So even if i try writing into it using response.getOutputStream(); it does not show any changes.
So when i run open my word file.The word doc is having the skeleton of my webpage and it searches for stylesheets .css when i try to open my saved word document.

Has anybody come across this before.This is really a driving me crazy for the past one week.

Best Regards,
Pallavi
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Call to JSF experts