Krystian Gor

Ranch Hand
+ Follow
since Jan 11, 2011
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
2
Received in last 30 days
0
Total given
4
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Krystian Gor

Ever heard of else?
11 years ago
Now I see. I debug line by line and when my program executes conn.getInputStream(); Wireshark instantly shows full HTML code of this site (from <html> to </html>). I didn't even start reading this stream with readline() nor with read(). Wow, I didn't know it works like this. I thought data is being downloaded part by part inside my while loop.
This program IS wasting bandwidth as I don't need <body>...</body>(100kB of data). I only want <head> ... </head>(first 1kB of data).

EDIT:
I will try to modify HTTP request to make response contain only a selected part of data (Range property)
12 years ago
I'm using a simple construction as this one:The output I get is:
But when I watch it on wireshark I can see whole page code being downloaded until </HTML>. How do I break connection after <body>? How do I read stream by fetching only x bytes?
12 years ago
Thanks! But then it's strange that the most recent NetBeans with the most recent Java EE 6 with the most recent JSF2.1 still creates a new JSF pages with
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
;]
12 years ago
JSF
OK, my investigation took me there:
Looking for ui: tags specification JSF2.0 specification says:

This tag library is the specified version of the ui: tag library found in pre JSF 2.0 Facelets. The specification for this
library can be found in the VDLDocs for the ui: library.


I found it here: http://download.oracle.com/javaee/6/javaserverfaces/2.1/docs/vdldocs/facelets/ui/include.html
It says:

There are three things this tag can include: plain XHTML, and XHTML pages that have either a composition tag or a component tag.


Seems like all of my propositions are right.
Anyway, are there any drawbacks of not including doctype within included pages?
12 years ago
JSF
As I still have this pdf document open and I'm sure the mistake I made must be something basic I start to read section 1.2 EL Expressions.
It turns out that there are two types of expressions.

An EL expression is parsed as either a value expression or a method expression. A value
expression refers to a value, whereas a method expression refers to a method on an
object.


We don't need method expression as you want your expression to return a value: true or false.
So I read more and find:

Faces (...) component model that requires expressions to represent more than just rvalues. It needs expressions to represent
references to data structures


Seems like you don't have to put your method name isUser. You only have to reference data structure. Your field name(data structure) is user, so your expression to access this field requires only a name of this field: user instead of isUser.
Try using this expression:

Should work.
I hope you're aware of few more mistakes in your code example as h:form tag doesn't have a render attribute. This attribute is rendered.
Another mistake is lack of quotes around your EL expression "".
So, correct code is:
<h:form rendered="#{!beanUser.user}" >

Good luck!
12 years ago
JSF
#{} is an expression of Expression Language.
Goggle to find out that EL is not a part of JSF specification. It's still part of JSP 2.1 specificaton(but its specification will be separated as it can be used not only with JSP).
So I download this part of JSP 2.1 specificaton: jsp-2_1-fr-spec-el.pdf.
When I open pdf I search for "operators". I scan area of the first occurrence to find a section called 1.9 Logical Operators.
I scroll to desired page and read:

1.9 Logical Operators
The logical operators are:
&& and and
|| and or
! and not
The evaluation of logical operators is described in the following sections.


Seems like exclamation mark is fine
12 years ago
JSF
Using JSF 2.0.6.
I know I can include pages using <ui:include> tag and I know how to do this. I ask about contents of included page.
Can it start like this?

<?xml version='1.0' encoding='UTF-8' ?>
<h:panelGroup xmlns="http://www.w3.org/1999/xhtml"
xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:h="http://java.sun.com/jsf/html">



Or maybe it has to start with ui:composition?

<?xml version='1.0' encoding='UTF-8' ?>
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:h="http://java.sun.com/jsf/html">



Is it necassary to include doctype declaration as well?

<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">



All of these work, but are there any requirements? I can't find anything about it in JSF specification. I tried searching PDF for "doctype" and "ui:include".
12 years ago
JSF
Using entity classes and accessing database with EntityManager would be more elegant and safer. Managing relations would be easier.
Strange usage of managed beans. I'm not familiar with what you're doing here.
Try reading some tutorials like this http://balusc.blogspot.com/2006/06/using-datatables.html
12 years ago
JSF
I'm happy you pointed out ICEfaces. That's what I'm using.
But forget ICEfaces, there seems to be problem with including one page into another.
I've seen many threads with questions why <ui:include doesn't work as it should. Like here https://coderanch.com/t/537924/JSF/java/Trying-change-ui-include-src
but I've never found a solution nor any approach.
<icecore:singleSubmit /> works great for ajax-submitting forms. But I don't have a clue how to use it to change content of displayed page.
One big xhtml page with many panelGroups triggered by rendered attributes is not a very elegant solution.
12 years ago
JSF
I'm trying to create RIA. Just RIA, nothing more. RIA also known as "one-screen-application"has consistent interface where only parts of page are refreshed and filled with new content.
Something like this:

Clicking menu links should reload main content with chosen page without realoading whole page.
12 years ago
JSF
Do you have any working code to add 'author' and 'book' to database? Show me if you have. It will be easier to say if I can help you.
Also show me your 'author' class and 'book' class.
12 years ago
JSF
1 Using Java

then in JSF

2. Using JSF

then in JSF
12 years ago
JSF