Florian Heinisch

Greenhorn
+ Follow
since Mar 03, 2005
Merit badge: grant badges
For More
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 Florian Heinisch

I tried to download the puzzles's source code but unfortunately www.javapuzzlers.com seems to be down. I also tried Addison-Wesley's website but there is not code available. Does anybody know where else to get the puzzles' source code?
18 years ago
Dear Bear,

Btw, you need to upcast the JspContext to PageContext to use it as such.



Thanks a lot for this hint! I am sorry, I did not think of upcasting
18 years ago
JSP
Dear all,

I read in Sun's J2EE� 1.4 Tutorial that a simple tag handler class has access to all implicit objects. The tutorial states at http://java.sun.com/j2ee/1.4/docs/tutorial/doc/JSPTags7.html:

"[...] the JspContext object provides access to implicit objects. PageContext extends JspContext with servlet-specific behavior. Through these objects, a tag handler can retrieve all the other implicit objects (request, session, and application) that are accessible from a JSP page [...]"

Well, I had a look at the JspContext class in the J2EE-API. I do not understand how the simple tag handler can have access to all 9 implicit objects (in particular the objects config, exception and pageContext). Although I had a thourough look in the JSP 2.0 spec and searched throughout the web I could not find any confirmation for that statement.

I really would apreciate if anybody could provide some clarification on this topic!

Thanks in advance,

Florian
18 years ago
JSP
Dear Sanat,

thank you so much! With the page directive it works perfect!
I did not know that isELIgnored is the default. The book "Head First Servlets & JSP" states on page 320 that EL is enabled by default. Also the JSP Spec says that "the default mode for JSP pages in a Web Application delivered using a web.xml using the Servlet 2.4 format is to evaluate EL expressions [...]" (see p. 1-87).
Nevertheless, without the directive <%@ page isELIgnored="false" %> it does not work.
I even tried to add in the web.xml the "el-ignored" tags (unfortunately I cannot post tags in this forum as they are ignored ) within the jsp-config settings which does not help, too. Is this an IBM-Websphere-specific "problem"?
[ April 07, 2005: Message edited by: Florian Heinisch ]
19 years ago
Dear all,
I am using Websphere Application Server 6.0 to test some simple JSPs. Therefore, I simply placed the JSPs within the DefaultApplication.ear web application which worked great so far.
But if I use expression language in a JSP, the EL statements are not interpreted and plainly displayed in the browser such as "Host: ${header.host}".
As far as I know the WAS v6.0 should comply with J2EE 1.4 where EL is included.
I had a look at the application's configuration but I did not find not any hints that could explain why EL is ignored.
I also tried at http://publib.boulder.ibm.com/infocenter/ws60help/index.jsp to find any information concering WAS v6.0 and EL but I did not.
I really would appreciate if anybody could help!
Many regards,
Florian

[ April 05, 2005: Message edited by: Florian Heinisch ]
[ April 05, 2005: Message edited by: Florian Heinisch ]
19 years ago
Hi Roland,

thanks a lot for your help! This was exactly what I was looking for!

Many regards,

Florian
19 years ago
Hi JavaRanchers,

I use IBM Websphere Application Server 6.0 for a project and was wondering were to find the Servlet Java-files the Container creates when it translates a JSP into a Servlet. I had a closer look to all related IBM Redbooks but could not find any hints. The book "Head First Servlets & JSP" states on page 294 that " [...] some Container vendors won't let you see the generated Java source, and keep only the compiled .class file."

Does anyone one whether the IBM Websphere Application Server 6.0 lets me see the generated Java-file? I would appreciate any answer even it is NO ;-)

Thanks a lot,

Florian
[ March 17, 2005: Message edited by: Florian Heinisch ]
19 years ago
Deploying a Servlet or Application means that you "bring" your Servlet/Application (e.g. from your development environment) to the Servlet container so you actually can "use" your Servlet/Application.

For each IBM Websphere server there exist public available pdf-documents that exactly describe how to deploy a web app to the Websphere server. Just try a Google search or click this: IBM WAS Library
19 years ago
Hey Ben Wood,

thanks a lot for your answer. I kept searching the JAVA API for quite some time before posting here - unfortunately I did not "discover" the FontMetrics stringWidth() method.
Thank you so much, you helped me a lot!

@David: I was not quite sure whether to post in the AWT or in the SERVLETS forum ... thanks for moving the question to the right place!
19 years ago
Hi all,
I am developing a Servlet where I read in an image on which I want to place some text exactly into the center of the image.

Is there a convenient way to center the text (horizontally and vertically) according to the jpeg's size? Or do I have to count the String's characters, check the font's size and calculate the String's x- and y-position to center the text?
Thanks for any hints!
19 years ago
Hi Mala,
I read some books concerning Servlets and JSPs. The book that helped me most to really understand this topic is "Head First Servlets & JSP". It is actually great fun to read this book. Just have a look at the customers reviews on Amazon.com and convince yourself.
19 years ago
In your Servlet you have to check your form fields' content. If there is something the user did not enter correctly you just "build" the whole form again and place the error message(s) into the form where ever you want them to show up. So the user sees the same form plus your error message(s).
[ March 04, 2005: Message edited by: Florian Heinisch ]
19 years ago
Hi James,

now I got the point. Thank you so much! You really helped me a lot!
19 years ago
Hi James,

thanks a lot for your quick answer. You brought me a step further. So the PrintWriter does not necessarily convert into Unicode, right?

What happens in the background when following code gets executed:

How does the String "Hello World" gets written to the ServletOutputStream?
19 years ago
I would like to know how PrintWriter really works. The Book "Head First Servlets & JSPs" states on page 132: "The PrintWriter wraps the ServletOutputStream [...] the PrintWriter has a reference to the ServletOutputStream and delegates calls to it. There's just ONE output stream back to the client, but the PrintWriter decorates the stream by adding higher-level character-friendly methods."

How does the PrintWriter get the reference? Is it implemented by the Servlet container? How does this work in detail?

Another fact that confused me a bit is William Brogden's statement in https://coderanch.com/t/351065/Servlets/java/Printwriter-vs-ServletOutputStream that the PrintWriter does Unicode character conversion. Does this mean that any text that I send from the servlet to the client via the PrintWriter arrives encoded in Unicode?

Thanks for any help!
[ March 03, 2005: Message edited by: Florian Heinisch ]
19 years ago