How to display string in html format on jsf page [closed] - string

It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.
Closed 10 years ago.
I m using jsf2.0. And i m making one email application, I m calling web service to read the content of the file, and i m using SAX parser to extract the content from the to read the file. And i m storing that content in string variable and set it in setter method. And displaying it in outputLabel. Now, problem is when the content is displayed in jsf page at that time it is not displaying in proper format. it's displayed in one line. But when i see the view source of page at that time in view source it's displayed in proper format. So,what should be the solution. Please reply me.
Thanks in advance.

Check out if h:outputText's escape flag set to false can help you.
escape: This attribute sets a boolean flag value that determines if
sensitive HTML and XML characters should be escaped in the output
generated by the component. It's default value is "true".
(Description from here)

Set the CSS white-space property of the parent element to pre.
E.g.
<h:outputText value="#{bean.xml}" styleClass="preformatted" />
with
.preformatted {
white-space: pre;
}

I think the good old html <pre>...</pre> around your text will display the text as you like it (assuming that it is a plain text without markup).

Related

JSF beginner , how to get this layout? [closed]

It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.
Closed 10 years ago.
i'm new on jsf and richfaces . Currently I'm developing my fistr jsf application (billing application) and i need of create the pages for insert orders and bill , the pages should have the following layout
My Layout
how to get this ?
You still have to use CSS to achieve this layout, it has (almost) nothing to do with JSF. Here you can find some nice examples and tutorials.
And for the JSF part, you will have the template page where you will define parts which you want to keep same on each page (like menu and footer) and parts which you want to replace on each page (this is usually the content). You can, for example, follow this tutorial from Mkyong.

How to hide / close the error message automatically while using <p:message>? [closed]

It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.
Closed 10 years ago.
I have this specification that when error message is displayed (while using <p:message>) due to validation message or some thing else it should close after sometime automatically.
How can i do that?
I am using primefaces
please give me a solution
Suppose you got the following code in your page
<h:form id="form1">
<p:messages id="messages"
and you have a <p:commandButton
Than you could do something like (You might need to replace $ with jQuery)
<p:commandButton onsuccess="setTimeout ( '$(\'#form1\\\\:messages\').hide()', 100);"...
Note that I've used \' and \\\\ to escape the ' and \\
you can specify timeout delay in milliseconds , I used 100 milliseconds
You can use jQuery for that. Try to combine functions delay() and hide(). Here are links:
hide and delay.

how to change sites contents Using Chrome Extension ? (Example) [closed]

It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.
Closed 10 years ago.
I Need A Page Action Or Browse Action with Files That Change An element In A Website
take a look at this: http://code.google.com/chrome/extensions/content_scripts.html
You can add javascript scripts and css stylesheets to a page to change the content.
good luck!
an example to change the background of www.google.com:
you create a .css file with:
body{
background-color:black;
}
when you made the .css file, add this to manifest.json:
"content_scripts": [
{
"matches": ["http://www.google.com/*"],
"css": ["[name].css"]
}
],
matches means it will be added to any website that begins with http://www.google.com/ because of the '*'.

XPath using contains in this situation? [closed]

It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.
Closed 10 years ago.
The situation in HTML:
<div class="someDivision">
<span class="firstSpan">...</span>
<span class="firstSpan">...</span>
<span class="firstSpan">
<span class="secondSpan">...</span>
<span class="secondSpan">
"Unique text"
<a>"Text which I need"</a>
I need access to the text contained in <a>.
Use:
//div[#class='someDivision']
/span[class='firstSpan']
/span[class='secondSpan' and contains(text()[1], 'Unique text')]
/a[1]
/text()[1]
I'm not entirely sure what you're asking, but if it's "How do I get the text in an a element that's preceded by a text node containing "Unique text" and is inside a span element with a class attribute equal to secondSpan, which itself is inside a span element with a class attribute equal to firstSpan, which itself is inside a div element with a class attribute equal to someDivision?" then this XPath should do the trick:
div[#class='someDivision']/span[#class='firstSpan']/span[#class='secondSpan']/a[contains(preceding-sibling::text(), '"Unique text"')]/text()

Send a user's text input to a database to update [closed]

It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.
Closed 11 years ago.
Pretty new here. But before I ask my question, I'm not looking for "teh codez". I just want to know how one would go about doing this.
I have some regular HTML textboxes in a web page, and I want to know how I would go about taking that input (ofcourse, textbox has special ID and so does the submit button), and submitting it to a database.
I'm using Visual Web Developer 2010 Express, and SQLserver 2008 R2 express as my database. Someone suggested using c#, but what methods would I use in C#? Throw me some methods, please?
HTML inputs
<span class="ui-state-default ui-corner-all ui-icon-disk ui-icon saveButton" title="Save" style="float:left"></span><input type="text" class="lace" id="march"/><br />
<span class="ui-state-default ui-corner-all ui-icon-disk ui-icon saveButton" title="Save" style="float:left"></span><input type="text" class="lace" id="march2"/><br />
<span class="ui-state-default ui-corner-all ui-icon-disk ui-icon saveButton" title="Save" style="float:left"></span><input type="text" class="lace" id="march3"/><br />
Everything above this HR is the previous question asked here.. To be more specific, I've looked through all the tutorials in the answer i've okayed..
To be more specific, What I'm trying to accomplish is this..
I have these textboxes, SQL server 2008 R2eXpress, and VisualWebDeveloper 2010eXpress.
These text boxes are to show the original value from the database when the page loads.. But the user is able to update them. Once they change the content in these textboxes, they hit submit, and it sends it to the database to update the table that the information is sitting in..Again, not really looking for "teh codez", but just solid methods or tutorials I could look at that will help me achieve what i'm trying to do.Thanks in advance
There are many different ways you can go.
If you're using "Web forms", the answer is entirely DIFFERENT from the one you're implictly asking. I definitely encourage you to look at web forms. There are many tutorials, including this one:
http://www.asp.net/web-forms/tutorials/tailspin-spyworks/tailspin-spyworks-part-1
However, you're asking about simple CGI:
Write some HTML
Put some tags, usually including a "submit" button in a "form" tag
Provide a CGI "action" handler on the server to receive the input
Here's a good example on how to do this with C#:
http://chalaki.com/8-steps-program-install-setup-call-csharp-cgi-programs-in-iis-7/321/
Yet a third possibility is to do your processing on the client side: using Javascript (or a Javascript framework like jQuery or Dojo) running on the client's browser.

Resources