Stefan Elfvinge

Ranch Hand
+ Follow
since Oct 29, 2001
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 Stefan Elfvinge

Hi!
Could someone give we a complete sample code on how
to retrieve a text in a BLOB(db:mysql)
I don't seem to understand how do it??!
samplecode(somewhere in a doPost):
req.getRequestDispatcher("resource").forward(req, res)
doSth()
doSthElse()
response.sendRedirect("resource2");
I was under the impression that once forward() is called the thread of execution proceeds within "resource", but it seems like an additional thread is created and executes doSth()...which in the end causes sendRedirect to be called twice(because "resource" dispatches to the same doPost with additional data)???
Could someone please verify this?
/Steffe
21 years ago
Working excellent, thanks!!!
21 years ago
Hi!
I'm using javax.mail in a webappliction. The message and subject vary as to who the recipient is, certain properties etc. To alert the reciever I would like to be able to use a BIG font sometimes in the message. Can someone tell if this is possible? Should I use java.awt.Font to somehow format the message?
Thanks in advance!
21 years ago
Thankyou for the answer! But I'm still puzzled.
samplecode from my app;
<jsp:useBean id="theMenuBean" scope="appliction" class="xxx.MenuBean" />
This snippet is from a js(1) that loads uses the bean for presentation-data that seldom changes.
<jsp:useBean id="theMenuBean" scope="page" class="xxx.MenuBean" />
...and this snippet is from a jsp(2) whos only responsibility is to load a certain .gif via an include-directive in another jsp(3). jsp(2) invokes a getXXX in the MenuBean.
Maybe this explanation to my puzzle was not necessary, but if I was unclear last time, maybe this helps.
Or should I delete the "useBean with pagescope"-directive, and ask the implicit applicationobject for the menuBean?? If that is the answer, what's the code to do this?: "application.getAttribute("theMenuBean")" and THEN invoke whatever method on the bean??? How do I get the applicationobject?
21 years ago
JSP
A jsp uses a simple javabean(not EJB) with applicationscope(data never to change unless some admin updates db with presentationdata), and another jsp uses the same bean, BUT is only interested in accessing it's state in pagescope. Does this affect the container
managing the bean in a "wrong" way or is this approach OK? I was wondering when the thread comes to the pagescope directive, finish executing this jsp, then "kills" the bean when it goes out of scope, even though I earlier stated applicationscope on the bean?
I just can't make this one out by reading the net or books...
21 years ago
JSP
The below snippet gives me align_left in the forms textarea:
<input type=Text name="title" value=<jsp:getProperty name="theCaseBean" property="title" /> align=left size=40 maxlength=40>
I assume the jsp-tag must be enclosed somehow??
21 years ago
JSP
If a jsp uses a bean with session-scope,
does that mean that the bean only can be referenced from this session or does it mean that every thread requesting the jsp has access to the SAME bean? The main question is: does the bean need to be threadsafe, or does the container instansiate new beans for every session?
Here's an MVC question: Not using EJB:s, would it seem like a good idea letting a servlet choose view depending on request-parameters and set bean-properties before dispatching to the view(jsp), then the jsp simply uses getProperty() against the bean??? If the beans properties needs to be set with db-data, who should have the responsibility to access the db? Servlet or the bean itself? What would be a normal approach?
Thanks!(newbie to MVC and jsp:s)
21 years ago
JSP
Thanks, Frank!
But what do think about the problem to get the container to "find" the html?
21 years ago
WHY???!!!
Is something fooled by the tags I'm trying to post???

[ July 19, 2002: Message edited by: Frank Carver ]
21 years ago
Last try, and I am SORRY:
<web-app id='/foo'>
<error-page exception-type='sol.caseman.EmailException'>
<location='/email_exception.html'/>
</web-app>
21 years ago
I'll try hardwriting it...

<web-app id='/foo'>
<error-page exception-type='java.lang.NullPointerException'<br /> location='/nullpointer.jsp'/>
</web-app>

21 years ago
sorry, here it is again without the code-tags:
<web-app id='/foo'>
<error-page exception-type='java.lang.NullPointerException'<br /> location='/nullpointer.jsp'/>
</web-app>
21 years ago
oops, this is the entire new approach:
21 years ago
Yes, I've tried every possible location-value- removing "/", removing "http:/" etc. AND crosschecked spellings 100 times. I even tried this approach in web.xml:

...though, without "id=/myapp"
but same errors!
Anyway, I solved it with HttpServletResponse stream to hardcode some html in the catch-block.
Poor solution? Maybe, but it works...
please comment on this and thanks for your reply!
/Steffe
21 years ago