The Struts template taglib handles this very nicely and is pretty
straightforward, although the Struts team is now recommending using a more
complex version of this called Tiles. Check it out.
runu rathi <[EMAIL PROTECTED]>
02/22/03 12:25 PM
Please respond to "Tomcat Users List"
Hi, all.
I'm finding that the JSP errorPage directive has a serious flaw.
Perhaps others out there have run into this and been as frustrated as I am
and hopefully come up with some solution...? The flaw is that, if the
response has already been committed, then the error page is just pl
Hi, Andoni.
I'm not 100% sure how this all works, but I think there's a
default system encoding on the system where your Tomcat is running. This
encoding determines how the form request parameters come across. I think
when I ran into a similar problem a while back I got around it by d
well khalid, u haven't seen fit to respond to me yet, so consider this to
be yer "light a fire under you" email!!!
[snip]
Please try to respond to me with some useful advice about how I can
successfully execute this JSP, because it doesn't look too much like
anyone else in this newsgroup much f
These are extremely clear and detailed instructions - nice, Denise...
Hopefully, this will help Steve emerge victorious from his year-long
battle against Tomcat. One thing though I wanted to point out is that the
values should match, so use the same thing ("greeting",
"Startup", or whatever)
Open a terminal window yourself first, then run
%CATALINA_HOME%/bin/startup.bat. Now you should be able to see the error
message without the window disappearing on you. Also, make sure the
JAVA_HOME points to the top level directory of your JDK ("C:\jdk1.3"
instead of "C:\jdk1.3\bin" for inst
Hi, Kenny.
I think this is basically how it works:
- Tomcat's conf web.xml sets the default session-timeout (in
session-config element) to use for all web apps.
- You can specify a different session-timeout in each specific web app you
deploy in the web app's WEB-INF/web.xml file.
- T
My guess is that the application is probably overriding the setting in
your web.xml by using the setMaxInactiveInterval method on the session
object.
"Kenny G. Dubuisson, Jr." <[EMAIL PROTECTED]>
12/19/02 09:07 AM
Please respond to "Tomcat Users List"
To: "Tomcat Users List" <
I think they're supposed to be, but I have found that the META tags
sometimes don't seem to work, whereas the JSP directive seems to be more
reliable.
"Andoni" <[EMAIL PROTECTED]>
12/19/02 08:37 AM
Please respond to "Tomcat Users List"
To: "Tomcat Users List" <[EMAIL PROTECTED
Looks like you're basically putting your images in its own web app. You
may need a WEB-INF directory and trivial web.xml file under the images
directory in order for Tomcat to like it as a web app (not sure though).
Then, I think your url for the image would be "/images/image.gif".
Alternative
Hi, all.
I saw a message someone posted to the list asking about this a few
days ago and have been eagerly waiting to see the responses (haven't been
any though), since I ran into the same problem when upgrading to Tomcat
4.1.12. To reiterate the problem, version 4.1.12 often gives thi
Just take a look at line 124 of the generated servlet (FamilyMain$jsp.java)
mentioned in the stack trace. This file will be under the work directory.
Look for code calling a method on an object, which in this error condition
happens to be null.
HTH,
-Jeff
request.getAttribute("javax.servlet.error.exception") is where you can find
the exception object thrown
FYI - javax.servlet.error.request_uri tells you what the original request was
HTH,
-Jeff
If you're looking for a very basic MVC implementation, you can use a small
part of what Struts offers and be able to save the time you would spend
writing your own. You do pretty much exactly what you wrote in your second
paragraph. Set up your struts-config.xml file to define your actions and
The classpath used when you do your Java compiling. Tomcat is not involved at
all at this stage in the game.
"Reis, Tom"
Oh, come on, the "this is Steve Burris" bit makes me giggle every time... ;)
Jacob Kjome
Hi, Alex.
Since JSP's are turned into servlets before they are executed, I don't
see why you couldn't do this. For your convenience, JSP's have some common
objects already available for use. The "application" object is equivalent to
the javax.servlet.ServletContext object you would get by
Thanks, Cédric and Peter Lin, for your responses. Both of you seem to be
saying that, instead of storing large objects in the session object, I should
be storing them in the application object (ServletContext). I find this to be
rather confusing. It seems like the overhead involved in storing
This is sort of off-topic, but I don't know of a better forum targeting Java
web/servlet programming. If anyone does know of one, could you let me know?
I'm basically wondering if others have found effective ways to avoid the
tempting but bad practice of loading up the session with all sorts of
This also depends on when you want the code executed. I believe overriding
init will only make that code execute when the servlet is first created. If
you want code executed on every call to the process method, someone here did
it by overriding the processPreprocess (method name? - have to chec
Thanks for the suggestion, Derrick. I just double-checked the manager app's
web.xml, and it looks good. I haven't changed it from the default
installation anyway, but here's what the security-constraint looks like.
Entire Application
/*
manager
Anybody have any ideas what I could be doing wrong? This is how I have my
tomcat-users.xml file set up in my $CATALINA_HOME/conf directory. I've done a
restart (actually several) since adding tcuser. When I try to go to
http://localhost:8080/manager, it prompts me for username and password. I
Hmm...no exceptions - I guess this is a different problem than what I've run
into then. Sorry I couldn't help. Good luck with your troubleshooting.
To change buffer size, you can use the JSP directive: <%@ page buffer="16kb"
%>
or, I believe you can set it on the response with setBufferSize( b
As far as I know, it sounds right to me...
"Jason Stortz"
Hi, Jason.
I believe that that is precisely the intended use of the
response.sendRedirect ... when you are redirecting OFF your site (to an
absolute path). The specs say that sendRedirect takes an absolute path, so it
is not good to use for forwarding around within your site, where relativ
Hi, Dave.
Did you check your log files for exceptions? I've seen behavior similar
to what you're describing with Tomcat 4.0.x running Standalone. What I've
seen is that it gets a full buffer's (defaults to 8K, like you're seeing, but
can be set to different size) worth of content and disp
Shouldn't moving the tools.jar be unnecessary if JAVA_HOME is set properly??
"Jacob Lund"
Actually, no, it looks like I was mistaken. Looking again at the error
message, it does seem like the seemingly malformed tag is understood to be a
JSP expression tag and the generated servlet code is correctly set to
"out.print( FormBean.getUserName() );" Sorry, don't know what the problem is
I think it is just a simple syntax error. The JSP expression tag on your
userName text field is incorrect - needs to be <%= without the space. You
have a scriptlet with =FormBean.getUserName() trying to be executed. It's
interesting to see that it looks like Tomcat equates an equals sign befor
Hi, Ron.
This is because Tomcat puts the servlets generated from JSP's in the
org.apache.jsp package. Therefore, when you reference your bean with no
package specified, it looks for it in this package and does not find it there.
You should see that as part of the error message - something
The servlet engine handles it for you. Definitely take a look at some
examples and the servlet spec, and it'll start to make more sense.
"Christian J.
Hi, Christian.
I would recommend now taking a good look at the Java Servlet
Specification and letting all these suggestions digest while you go through
that. Things should start to make more sense once you have a better handle on
servlets. Maybe take a look at the Tomcat servlet examples
Well, the classes themselves wouldn't be used to get the init params or read
the db.properties file. You would use a Servlet to do that, and then you
would just pass the params (or Connections created from those params - however
you're doing things) to the instance of the DAO class you would be
If you don't want to go the JNDI route, you could also do something like set
init params in each application's web.xml file with the db connection info or
create a .properties file for each application and read in the db connection
info from that.
HTH,
-Jeff
Hi, Kevin.
Correction: Database locked by YOU! :)
You've closed the statement but not the connection. You need a conn.close()
after the commit. This shouldn't lock the database by itself, although if you
keep leaving connections open, then you will eventually hit a connection max
limit,
It looks like the output is probably in UTF-8 format. If you use the <%@ page
contentType="text/html;charset=UTF-8" %> directive in your page, that should
instruct the browser to use that encoding for display. To see if this should
work, you should be able to just manually change your browser's
Hi, Christian.
I haven't run into this problem before, so I'm not sure, but it looks
like the compiler is encoding the accented characters. Perhaps if you specify
the JSP page's encoding, it won't do that anymore...? Try using a directive
at the top of your JSP to do this, something like
You sure that your "test" table has a "test" column? Change rs.getString
("test") to rs.getString(1) to see if that works...
HTH
"Philip
If you have multiple users sharing the same bean, then that's what's going to
happen. By synchronizing the get and set method, all you're doing is saying
"Make sure the user finishes this whole get or set method before any other
user can start it." However, that won't prevent another user from
I would suspect that your "return boolean" line in your defineCFDatabase
method would be causing problems.
Uma Munugala
I ran into this a while back. Attribute "page" has no value!? ...quite a
bizarre error, isn't it?
I think that what I found out about this was that it happens for particularly
large jsp pages (not large in terms of lots of HTML output but in terms of
having lots of code in them) for some unknow
I ran into what I think is this problem before too, and here's what I ended up
finding...
I noticed the same thing as you, that the HTML was incomplete. My HTML was
stopped right in the middle of a big list of SELECT OPTION's. I thought there
was something wrong with the particular option that
Did you actually look at these log files first? I only know a few words in
French, but enough to see from your catalina.out that it could not create a
jar file cache in your /tmp directory because it doesn't exist. The errors in
the localhost_log file seem to result from this as well, so why do
If you are getting any pages back from the server, then you are using the
response object! You may not be manipulating it with an explicit reference to
it, but, when you have HTML or do an <% out.println("STUFF") %> or output a
JSP expression like <%= something %> in your JSP pages, you are usin
Hi, Oliver.
I can offer an idea (doubt it would qualify as brilliant though - sorry).
If you do a getResource from the ServletContext, it will give you a
java.net.URL. Then, maybe you could do an openConnection on the URL to get a
URLConnection. Then, try the getLastModified method on that.
Additionally, there are syntax problems with your insert statement line as
well (missing double quotes around the whole parameter). Might want to think
about taking these kind of questions to a java newsgroup (comp.lang.java.help
or comp.lang.java.programmer) for more/better responses, since the
Hi, Richard.
I can definitely relate. This frustrated (sort of still does frustrate)
me to no end. Let me try to explain what I understand after wrestling with
this for a while. (gurus, if anything isn't quite right, please chime in!)
1.) The following are all supposed to have the same
Hi, Brian.
This doesn't tell you that it can't find the class referenced in your JSP
page. If that were the case, you wouldn't have gotten a 404 error - you
would've gotten to a page with a class not found exception. That tells you
that it can't find the JSP page itself. In order for Tom
Just noticed that you're using tomcat 3.2, so this wouldn't be an option
unless you upgraded to version 4. I don't know of a way to do it under
version 3 (doesn't mean there isn't one).
Hi, Franck.
I'm not sure if this would work, but maybe you could try to define a
$CATALINA_BASE that is on the hard disk while keeping the $CATALINA_HOME
pointed to the CD...? Just a thought.
Good luck.
-Jeff
Hi.
I was wondering if anyone out there has a good way of restarting Tomcat
4...? In version 3, I used to just be able to do
"$TOMCAT_HOME/bin/shutdown.sh; $TOMCAT_HOME/bin/startup.sh". Now, in version
4 though, since the starting and stopping scripts seem to have been modified
to be backg
jar -xf filename.war
John Wadkin
Or you could just do that... :/
Very cool! Thanks for that nugget, Christopher.
"Christopher
There is no session.isInvalid() method - that wouldn't make any sense anyway.
If you have an actual session to ask if it's valid or not, how could it ever
be invalid? There is an isNew() method, and I have not used this, but from
reading the spec it doesn't sound like it will do the trick.
Ther
Hi, Christopher.
Here are some things to look into...
- Make sure that your JSP page is set to use a font that can display the
specific Unicode characters. If it's just a specific subset of the Unicode
character set, then you may be able to find a lightweight font that handles
that specifi
You can use <%@ page contentType="text/html;charset=UTF-8" %> in the JSP or
alternatively include the tag in your HTML. This will tell the browser to use the UTF-8
Encoding.
Then when getting the requests, you can do a request.setCharacterEncoding
("UTF-8") before getting anything from the req
It's included in $CATALINA_HOME/common/lib/servlet.jar.
Tom Bednarz
Hi, Ross.
This sort of defeats the purpose of beans. You should develop your beans
without any dependencies whatsoever on servlet-specific stuff, like requests
or sessions. This way, your model is independent of the "web" environment and
could be used in some other context. Your servlet
It's just like the message says... parseInt( String ) is not a method found
in your jsp page. Make that "Integer.parseInt(myString)" and you're golden.
also... fyi, you don't close the tag in your html.
HTH,
-Jeff
Hi, Luiz.
I think the equals sign in the parameter value needs to be escaped. Take
a look at the java.net.URLEncoder class to help with that.
HTH,
-Jeff
Hi.
This seems to be a new thing in Tomcat 4. I have a page set to Unicode
(UTF-8) encoding. When I submit the form on this page, the characters of the
input values are getting magically (I hate when things are done magically)
transformed into the corresponding HTML Unicode character entit
Since it's not in the java.lang package (the one you get for free), you need
to import the class...
<%@ page import="java.util.Vector" %>
... or reference it with its full package in your code.
Hi, Michael.
The <%@ include ... %> tag is a static include, and, once the page that
includes something like this has been compiled, a change to the included file
will not trigger a recompile of the page. As far as I know, you have to
either change the modification date of the main page (c
Hello.
I'm having a problem which I believe is related to Tomcat 4, since I
didn't see this happening on 3.2 before I upgraded. I have a form on a page
that is set to UTF-8 character encoding. When I paste a Unicode character
into an input field and submit the form, the characters are bein
64 matches
Mail list logo