Paul Speijers

Greenhorn
+ Follow
since Apr 10, 2005
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Paul Speijers

I would like to extend the facelets ActionListener for exception handling purposes. The problem is that I don't know the default facelets ActionListener implementation class to extend. "Regular JSF" usually has a class called "ActionListenerImpl" but I can't seem to find that one in facelets.
14 years ago
JSF
Hi Reema,

When you access your JSF pages using the .jsp extension your files get interpreted as JSP pages. Therefore, you get a nullpointer exception because the JSF elements are not recognized.

You probably have the following servlet definition and mapping in your WEB-INF/web.xml:

<!-- Faces Servlet -->
<servlet>
<servlet-name>Faces Servlet</servlet-name>
<servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
<load-on-startup>1</load-on-startup>
</servlet>

<!-- Faces Servlet Mapping -->
<servlet-mapping>
<servlet-name>Faces Servlet</servlet-name>
<url-pattern>*.faces</url-pattern>
</servlet-mapping>

This means that when an URL is encountered which ends with .faces, it is being handled by the Faces Servlet, which interprets the corresponding .jsp file as being a JSF file. Therefore, that does work.

Good luck!
14 years ago
JSF
That's a good point which I forgot to mention, the generated CSS is correct.

<link rel="stylesheet" type="text/css" href="/BuyABike/theme/stylesheet.css" />

The weird thing is that the generated CSS is the same in the cases where the CSS is applied and when it isn't
14 years ago
JSF
In every page of my webapplication I'm using facelets layout page which includes a stylesheet. In order to include the stylesheet I've tried the following options:

Determining the absolute path using a JSF expression:
<link rel="stylesheet" type="text/css" href="#{facesContext.externalContext.request.contextPath}/theme/stylesheet.css" />

And by using the tomahawk stylesheet tag:
<t:stylesheet path="/theme/stylesheet.css" />

I'm using an index.jsp page which forwards to the first page of my webapplication using:
<jsp:forward page="shop/selectbicycle.jsf" />

However, I encounter the following problem:
When I access the index.jsp page it forwards to the selectbicycle.xhtml page and I see my page with the right layout. In other words, the CSS gets applied.
However, after the next requests to other facelets pages (*.jsf gets mapped to *.xhtml), the CSS is not applied to the pages.

Can anyone help me with this? Thanks a lot.

By the way, my layout page looks as follow:


[ April 19, 2007: Message edited by: Paul Speijers ]
14 years ago
JSF
I'm not sure about the DataFormatException, it's in the Zip package so I guess it has something to do with files within zipfiles having the wrong format. The ParseException however in general occurs when you try to convert a string literal to a primitive with one of the wrapper classes.
16 years ago
I've been trying to use a label, but the label text won't wrap. The text is just clipped off at the right of the label.
I simply instantiate it using:

Label label = new Label(composite, SWT.WRAP);

I'm using the label within a composite, which is in a flowlayout.

I'm using the SWT version included with Eclipse 3.0.
16 years ago
What situation will you be using the Exception for?
16 years ago
Seems like a pretty simple problem, but I've been looking my ass of for it and can't find it.

I want to read 1 character from stdin and disable the user to type more than 1 char, like the C getch() method. I've tried the read and readChar methods of many Readers and InputStreams classes (e.g. BufferedReader, InputStreamReader, DataInputStream, InputStream) but they all permit the user to type in a String and return the first character of the String when the user hits the enter button. I want to have the char returned immediately after the user hits a key and disable the user from typing more.
16 years ago