Try this:
SELECT RequestID FROM TRequest
WHERE OrderNum = (SELECT MAX(OrderNum) FROM TRequest);
===
To unsubscribe: mailto [EMAIL PROTECTED] with body: signoff JSP-INTEREST.
For digest: mailto [EMAIL PROTECTED] with body:
perhaps string.trim() will serve this purpose?
-Original Message-
From: sufi malak [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, February 12, 2002 12:25 PM
To: [EMAIL PROTECTED]
Subject: Re: FileWriter question
no, it does not work.
another question please how to get rid of an \n from a
That was seriously off topic, but really cool nonetheless...
Kind of irritating to cut and paste that HTML though. I've posted it here
instead:
http://www.joecheng.com/clock.html
-Original Message-
From: A mailing list about Java Server Pages specification and reference
[mailto:[EMAIL
Each Action class should correspond to one request type, so if you
support retrieving data with one request and update with another,
you should have two Access classes. If you have one request type
that combines multiple database operations, say update information
and then retrieves the updated
The run-time performance of this class is fine, but with multiple
developers everyone want to access this file at the same time. :(
If this is the only reason you're abandoning the one-class approach, perhaps
you should consider a source control system that will let multiple
developers easily
The getVariableInfo method is not called each time the JSP page is executed;
it only gets called when the JSP is being translated to a .java file and
then compiled. (I think that's called translation time) In other words,
only the first time after you've made a modification to the page.
I doubt it, just like you can't really catch a 404, right?
Look in your server's documentation, there should be somewhere you can at
least assign a static HTML page to a 500 error. And information about the
500 should be written to server logs somewhere.
How about %= vBirthDate.getTime() %
===
To unsubscribe: mailto [EMAIL PROTECTED] with body: signoff JSP-INTEREST.
For digest: mailto [EMAIL PROTECTED] with body: set JSP-INTEREST DIGEST.
Some relevant FAQs on JSP/Servlets
ia.getHostAddress()
how did you find getHostName but not getHostAddress?? they're right next to
each other in the javadocs.
===
To unsubscribe: mailto [EMAIL PROTECTED] with body: signoff JSP-INTEREST.
For digest: mailto
That's good to know.
But, 155.108.0.1 *is* a valid IP address, right? Is 155.108.255.1?
-Original Message-
From: Clayton Nash [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, February 05, 2002 6:09 AM
To: [EMAIL PROTECTED]
Subject: Re: increment IP address ??
Note that 155.108.0.0 is not a
That's an incredible amount of memory to be using up!! Are you sure it's
not buggy application-level code or perhaps a poorly implemented third-party
library? (Didn't the ODBC-JDBC bridge used to have a memory leak?)
What kind of data are you storing in the session/request? How much traffic
This will print out all IP addresses in 155.108.x.x.
public static void main(String[] args) {
final int start = 0;
final int end = 255;
for (int i = start; i = end; i++) {
for (int j = start; j = end; j++) {
System.out.println(155.108. + i + . + j);
}
}
}
Depends very much on what servlet container you're using... I believe
there's an optional task included with the distribution that does the job
for WebLogic (oops, 4.5.1 only).
I don't know why nobody seems to have written one for Tomcat, as it supports
command line jsp compiling...?
I spoke too soon. Apparently there is an Ant jspc task, it exists in the
CVS repository but I guess it hasn't been released yet...?
Here's the manual page on it:
http://cvs.apache.org/viewcvs/~checkout~/jakarta-ant/docs/manual/OptionalTas
ks/jspc.html?rev=1.5
Here's the page for the actual
Hmmm. I'd be surprised if Jasper (what JspC) doesn't support proper
handling of taglibs... cause if I'm not mistaken it's the same JSP compiler
that tomcat uses for on the fly compilation. Maybe it was a configuration
issue...?
Well, Phil, let us all know how it turns out.
The library com.oreilly.servlet has classes for handling multipart requests.
http://www.servlets.com/cos/index.html
===
To unsubscribe: mailto [EMAIL PROTECTED] with body: signoff JSP-INTEREST.
For digest: mailto [EMAIL
I found this list:
http://tcl.activestate.com:8002/resource/software/tools/www/?sortby=date
Maybe WinCGI is what you're looking for? I can't imagine it'll be very
fast/efficient since it's a regular CGI implementation, but if you need
better TCL support you might have to move to AOLserver or
I have placed all my Beans in a package called mybeans in the
web-inf\classes directory.
only unpacked classfiles go into /WEB-INF/classes directory. jar files go
into the /WEB-INF/lib directory. Tomcat should then automatically pick them
up.
Yeah, Hans is great.
I'd also recommend Core Servlets and JavaServer Pages, by Marty Hall.
-Original Message-
From: Steve Bang [mailto:[EMAIL PROTECTED]]
Sent: Monday, January 28, 2002 6:33 PM
To: [EMAIL PROTECTED]
Subject: Re: Book
Buy either:
JavaServer Pages
~
-
Agreed... the 1-pixel GIF in table approach is pretty foolproof.
If you need more than bar charts, check out this lib... not bad, and it's
open-source.
http://www.jrefinery.com/jfreechart/
-Original Message-
My own use has included tiny, 1-pixel gifs in a TD width= Plenty
Yes, there are two ways I know of. The best way is to write a tag that does
this for you. In other words:
a:cache id=thispage.jsp_js1 timetolive=200
%-- any arbitrary JSP/HTML/JavaScript here --%
/a:cache
Capturing the output is quite easy to do if you're familiar with writing
tags. Just
Tim,
Do you know if this is true just for Tomcat (or even specific versions of
Tomcat) or is it true for all servlet containers?
-jmc
===
To unsubscribe: mailto [EMAIL PROTECTED] with body: signoff JSP-INTEREST.
For
IMHO, it's a bad practice to rely on your system's CLASSPATH. Instead, if
your classes and/or jar are specific to one web application, put it in
/WEB-INF/classes and/or /WEB-INF/lib. If you have a jar that needs to be
used across all web applications, use tomcat/lib.
For compiling your
Zvika,
The default behavior for servlets is to have a *single* servlet instance
serve all incoming requests for that servlet, simultaneously. In other
words, it's not that each incoming request instantiates your servlet; on the
contrary, the servlet only gets instantiated once in the lifetime
I'm afraid we're having somewhat of deaf people's conversation here. Read
Brian's original post and his response and see what I mean.
Zvika, I thought you were replying to my message, not Brian's response... my
apologies.
FWIW, I haven't looked into it but it sounds like JDK 1.4's java.nio.*
Say what?!? I've written tons of Java applications that have more than
one public class.
I think he meant if you have more than one class in your FILE then only
one of them can be public.
===
To unsubscribe: mailto
I didn't realize i will be initiated as 0 if it is not be specified, so
you guys mean i=0 is system default?
Apparently so. I wouldn't have believed it but it just worked, under JDK
1.3.1 on Windows 2000. The following code outputs 0.
public class NotInit
{
static int i;
Can you post the servlet code? What servlet container are you using
(WebLogic, Tomcat...?)
The servlet should absolutely be able to handle two simultaneous requests,
unless your service method is synchronized.
===
To
Depends on the servlet container implementation. I think usually (i.e.
Tomcat) it's just stored in memory. With WebLogic it does at least
sometimes persist to disk.
How much stuff could you possibly be storing in memory? If you've got a
reasonable server hardware configuration and you're
if (check == false)
{
i = 2;
i = i + 2;
}
else
i = i + 4;
-Original Message-
From: Miao, Franco CAWS:EX [mailto:[EMAIL PROTECTED]]
Sent: Monday, January 14, 2002 5:35 PM
To: [EMAIL PROTECTED]
Subject: A java question.
class test {
static boolean check;
It's probably safer to do the page directive rather than meta tag. If you
look at the generated .java file, you'll see that the content type header
gets set before your JSP code even starts executing. In my installation of
Tomcat 3.2.4 it's this line:
Title: RE: Difference between html meta tag and jsp page directive
Hmm, good
question. Seems worth a shot.
Be sure to
try it with different browsers, and if you run into problems try making the bean
call happen before any data gets pushed to the browser--including
whitespace.
Also, you
may
Don't forget to check for the case where getParameterValues(param) returns
null. That's what happens when all the checkboxes are left blank...
===
To unsubscribe: mailto [EMAIL PROTECTED] with body: signoff JSP-INTEREST.
Believe it or not, it's a bug in Tomcat 3.3. Works fine in 3.2.4 and 4.x
though. The bug has been fixed (twice) in 3.3 but the current release does
not include that fix.
Our company has experienced exactly this problem and it has forced us to go
back to 3.2.4.
-jmc
How about using request.getParameterNames(). Another possibility is a
hidden field with the form names.
Those are two good suggestions. The second one is particularly well-suited
for your example, since it will allow you to detect if any of the radio
buttons were left blank.
Tim's right, you should ALWAYS use encodeURL from the beginning of your
project--it doesn't take much effort and it will save you heartache in the
future. And it's part of the Servlet spec, who knows if they will use it
for something else in the future.
Or even better, create your own method
I would like to know from where do i start for jsp and j2ee i hve the
j2ee tutorial by sun only is that enough.
learn Java first. then try Core Servlets and JavaServer Pages by Sun
(www.corejsp.com).
===
To unsubscribe:
URL rewriting is part of the spec. You need to use response.encodeURL()
around every one of the links you put on your site.
For example, instead of:
a href=page2.jspnext page/a
you need to do:
a href=%= response.encodeURL(page2.jsp) %next page/a
If you do this, then the servlet container
Merrill's right, this technique absolutely won't work because the most it
could do is get the username at the server, not the client.
Maybe if you're using IIS as your webserver, you could set the directory
security to enforce NT authentication, then see if the request has any
security-related
It depends on how you are navigating from elmpleelist.jsp to
EmployeeListView.jsp. If you are using response.sendRedirect then you must
store it in the session. If you are using
request.getRequestDispatcher().forward() or jsp:forward then you should
store it in the request
I've never worked with jsp:param but I'm guessing the name attribute does
not accept runtime values--taglib attributes can be specified as runtime or
not.
Another way to do it is to build a querystring with your new params and
forward that way.
Ravindra,
Since
you're using the %! directive, you're just declaring methods, not actually
calling them. You need to actually call them.
You should
also be aware that what you're doing is incredibly dangerous. If two
requests hit this page at the same time your output will be corrupt. The
I've never actually done this but I believe what you can do is create a
DateFormat object and call its setTimeZone(TimeZone t) method, then parse a
Date object with it.
-Original Message-
From: Boddula, Sridhar [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, December 12, 2001 10:46 AM
To:
To me, the main advantage (or difference) to use a jsp bean (jsp:usebean
... over a class bean, i.e. a normal java class, is that you can clearly
specify the life cycle of your bean objects using the scope attribute.
How is this any different than simply placing the object/bean into the
Make sure you do not have any input/output streams open on the file. If you
do, you won't be able to delete or rename the file.
Can you post your Java code here?
===
To unsubscribe: mailto [EMAIL PROTECTED] with body:
I don't think IP is necessarily the best way to do it, as IP addresses
within an intranet can change if you use DHCP (as most LANs do).
I've never tried it on a Java platform but I do believe using Internet
Explorer and IIS there is some way to do NTLM authentication, i.e. Internet
Explorer
Do you have cookies enabled in Netscape 6?
===
To unsubscribe: mailto [EMAIL PROTECTED] with body: signoff JSP-INTEREST.
For digest: mailto [EMAIL PROTECTED] with body: set JSP-INTEREST DIGEST.
Some relevant FAQs on
I prefer the second method. Taglibs tie your business logic too closely
with JSP.
Might I suggest a third possibility, to have normal Java classes for your
business logic and then taglibs to call those classes from JSP.
What is the diference between putting the resultset into a list and
using the list as a session attribute, vs using a bean to hold the
resultset values? They seem about the same to me (an ultra-newbie),
except that a bean can have narrower scope. COuld somebody put qa
piece of code showing the
You can store the objects you want to pass in the request scope.
public void request.setAttribute(String attrname, Object value)
public Object request.getAttribute(String attrname)
Your servlet code would look like:
request.setAttribute(myData, rs);
You do not have to do any declarations (of the %! % type) to do what you
want to do.
You would probably have to import the Employee class, is all. If Employee
lived in a package com.mycom, just do %@ page import=com.mycom.Employee
%
I personally never use the JavaBean framework, e.g.
yeah, should work fine.
===
To unsubscribe: mailto [EMAIL PROTECTED] with body: signoff JSP-INTEREST.
For digest: mailto [EMAIL PROTECTED] with body: set JSP-INTEREST DIGEST.
Some relevant FAQs on JSP/Servlets can be found
If I'm not wrong, you can't forward after being sent code to the
client. So if you send some html code for the page, you can't use
forward.
You can do a server-side forward... you just can't do a
response.sendRedirect().
Keep in mind that if a checkbox is not checked, then NO value at all will be
passed by that element. For example:
input type=checkbox name=foo value=true
If the checkbox is checked, then request.getParameter(foo) will be true.
However, if it is not checked then request.getParameter(foo) will
As modern Java web apps go, 300+ strings being instantiated is no big deal.
Resource bundles may or may not be a better approach, but if they are the
right choice it's not because it will be less resource consuming, it will be
because you get more flexibility/maintainability.
I don't know if you mean to say javascript in your subject line. But if
you are looking to use request parameters in your JavaScript (which is
client-side) then you can either do what Tim suggested or use JavaScript to
retrieve the parameters directly.
You'll need this JS file:
I don't know the answer to your question. But, why would an encoded URL use
a ; in place of ?? That would be a good candidate for breaking your
IIS-Tomcat mapping.
===
To unsubscribe: mailto [EMAIL PROTECTED] with body:
Without using the LAST_INSERT_ID() (which is proprietary, and I don't know
if there is a way to get to it through JDBC...??), there are a couple of
ugly ways to do it that I know of.
One way is to do the SELECT MAX, but also include a WHERE clause that
includes all of the info you've just
The standard method if you are going to code it yourself is to multiply
by 100, add 0.5, truncate the decimal portion, then divide by 100.
That's for the nearest cent... I think what our friend actually wants is
something like:
double newValue = Math.floor(origValue * 20.0) / 20.0;
Note that
Is there any utility to do documentation for JSP pages
as we have JavaDoc Uitlity for Java.
I'm pretty sure there isn't. Probably because if you use JSP the way Sun
intends you to (i.e. no business logic), there should not be any need for
JSP docs.
Title: RE: Documentation in JSP
http://java.sun.com/blueprints/guidelines/designing_enterprise_applications/web_tier/index.html
Look
particularly at "Servlets and JSP", "JSP Page Design", and "Application
Designs".
But
basically, ideally there should be no scriptlets (% % sections) in your
How did you end up with an image file in a String? You'd probably rather
have it in a byte array, ByteArrayInputStream, or FileInputStream.
In any case, you want to use response.getOutputStream() in a servlet (not
JSP) to push it to the web browser. Call ServletOutputStream.print(int)
over and
That's ridiculous. The comparison between Netscape 4.x and 6.x is not at
all relevant, since that's talking about client-side applications. Sure,
Java for client side applications has its share of problems, including
performance and memory consumption. But Java on the server side is a far
if you need code completion in an nice editor try
Jext www.jext.org
Ryan-
Wow, Jext is cool... thanks for pointing it out. Probably the cleanest
interface of any Java-based IDE I've used, and though it takes a little
while to load it's reasonably snappy once it's running.
I can't for the
i know that jsp:include works with jsp1.0 but does
not with jsp1.1.
Is that statement true? I don't think so...
If it is true, you can always use this to do a runtime include:
% request.getRequestDispatcher(/newpage.jsp).include(request, response);
%
where obviously /newpage.jsp should be
so you mean after specify the class path in Vj++, then Vj++ will be able
to
run any Sun Java based native code?
No... VJ++ uses jview(? I can't remember) and jvc instead of java and javac,
which can potentially cause problems. I certainly don't recommend
compiling, running, or interactively
if you can afford to do it in a Java applet, a quick search on Google
resulted in this. i'm sure there are tons of others out there.
http://javaboutique.internet.com/AJTree/
===
To unsubscribe: mailto [EMAIL PROTECTED]
I don't know for sure. But can you try out.flush() right before you perform
the include? Perhaps that will help.
-jmc
===
To unsubscribe: mailto [EMAIL PROTECTED] with body: signoff JSP-INTEREST.
For digest: mailto [EMAIL
Use request.getRequestURI()
I believe that actually will leave off the querystring? Craig, don't know
if you intended that to be part of it or not.
If you want the full querystring you can use this method:
javax.servlet.http.HttpUtils.getRequestURL(HttpServletRequest req)
whoops, I just
If you're using the servlet method, and specify load-on-startup, you want
to put the startup code in Servlet.init(), right? (as opposed to the
Servlet.service() method.)
I've never actually needed to use that parameter but it seems like a good
thing to know...
Macromedia stopped supporting Kawa some time before. Guys Dont stick
with IDEs .Use simple editors like editplus,TextPad or the best VI or GVIM.
I personally think code completion alone is reason enough to use an IDE.
Visual SlickEdit (www.slickedit.com) is pretty good from what I hear. I
hi, just wondering, import the latest JDK 1.3 rt.jar to which folder if I
am
goint to use Vj++6.0? and how to do the import job, copy the rt.jar file or
do import job inside Vj++6.0?
If c:\jdk1.3 is your java install dir, you want this jar file:
C:\jdk1.3\jre\lib\rt.jar
Don't copy it
Aaargh. Why won't this thread die!! :)
All you need to know is... use PreparedStatement (or properly escape your
string values) and there is NO WAY the user can slip in SQL commands.
NO WAY at all.
If you don't believe me, just try it yourself. (unless there is a bug in
the particular JDBC
Actually, what you might want to do is have all your servlets extend one
class, and have the include code there. For example:
public abstract class MyBaseServlet extends HttpServlet
{
public abstract void MyService(HttpServReq request, HttpServResp response)
{};
public void
Can you post the line or section of code that is throwing the exception?
===
To unsubscribe: mailto [EMAIL PROTECTED] with body: signoff JSP-INTEREST.
For digest: mailto [EMAIL PROTECTED] with body: set JSP-INTEREST DIGEST.
but then I can not hide the Javascript file, I saw a website has floating
object, I knew it is running Javascript, but can see it in Soure menul in
brower, but frame somthing, just wondering how this web guy hide
the javascript. I guess this guy program javascript run at server side.
this technique worked fine for me on weblogic 5. I can't show you any
examples though.
===
To unsubscribe: mailto [EMAIL PROTECTED] with body: signoff JSP-INTEREST.
For digest: mailto [EMAIL PROTECTED] with body: set
It's kind of a pain but the best way I know is to do it this way.
In the form itself, have a hidden variable... we'll call it uniqueid.
This needs to be dynamically generated every time the form is called from
the server, and the value must be a unique ID... I'm lazy so I use
Celeste,
what's a more secure means? now you've got me curious.
and Bob wasn't pointing out a loophole, just calling attention to the
non-escaped values in the SQL statement below.
-jmc
===
To unsubscribe: mailto [EMAIL
I'm with Hans on this one. Any examples of a JDBC driver where
PreparedStatement doesn't behave like that?
I also agree with Hans.
If you use PreparedStatement and setString(), or do the escaping yourself,
there is NO loophole... at least not with any reasonably well-written JDBC
driver. To
Title: Message
Praveen-
It looks like your query is retrieving the whole set of users and then
iterating in Java to see if any of them match the username/password the user
entered. Why would you do that, rather than simply:
SELECT * FROM users WHERE username = 'username entered by user'
AND
Praveen-
Wait a minute, are you actually getting an exception thrown, or is that
String comparison line just not getting executed? Your original e-mail
implied the latter, but your second e-mail implies the former.
If there is an exception being thrown, please let us know exactly what it
is.
If you are selecting data from a database and that database happens to be
Oracle look at the connect by clause. It does everything you are looking
for.
that's really interesting, I've never heard of connect by. can you or
Ross provide more detail, i.e. what does the resulting recordset look
My boss, who doesn't really know or understand anything about web
applications, has decided to save some money on a JSP/Java web application
that we have developed as an intranet site, by setting up the site to run as
an internet site, but using Citrix to make it available to people outside
the
I had to do this once... fun problem.
First of all, forget about doing it in JSP... you should use Java classes
for this.
Two ways to do it, IMO. If you have a large and flat dataset, i.e. many
records in the table but no trees that go more than a few generations deep,
you can have a method in
I am probably asking way to much, but is there a magic program that will
convert a Cold Fusion web site to JSP?
you're asking way too much. :)
although, there are rumors that CF 6 will be based on Java technology and
that CFML will be implemented using taglib.
What database are you using? Is it possible that it's the database that is
causing the problem?
Also, what are you doing with the data--are you trying to store all 1
million records worth of data in some bean? It will almost certainly be
better to retrieve/use each record one at a time, rather
Doesn't too few parameters usually mean you've spelled one of the
table/field names incorrectly? Are you sure it's the single quotes that's
the problem... try removing the WHERE clause entirely.
There's no reason your code shouldn't work, unless the variable search
itself contains single
Title: RE: single quote problem
I thought
"too few parameters" meant you are not passing enough variables...
You'd think so, wouldn't
you?
I just tried querying my own Access db, "SELECT foo,
bar, useridFROM users;". The table "users" and field "userid" exist
but foo, bar don't. The error I
I wonder if the spaces in the classpath pose a problem... try using the
shortnames for Program Files and Adaptive Server Anywhere 6.0...
because servlet.jar is where those classes should live.
===
To unsubscribe: mailto
just change the submit button's call to doublePost to customize it. use
this.name (no quotes because its a variable) to post to the current window
or frame. When you put '_blank' it will open a new window.
I don't know if it's really necessary, but you also may want to have the
doublePost
If you can get away with targeting IE only, you can append the HTML to the
.innerHtml property (a property of many objects including div and span).
===
To unsubscribe: mailto [EMAIL PROTECTED] with body: signoff
my requirement is to display the data on the front end without any time
interval when ever the data changes in the table that perticular field of
the record only must change on the front end without refreshing the entire
page. (please don't recomend meta tags)
I haven't heard of any really
Chris is right, according to your example. And note that your second query
actually executes once for *each row* that gets returned in the first
query--so if your first query has more than a few rows, you're incurring a
huge amount of overhead. So, first of all, try to use a join or subquery to
How about using a trigger on the database that instantly knows when the
data has changed, like that no unnecessary refreshes have to be done on the
client side when the data hasn't been changed?
Can you elaborate? So the database tells some server-side Java code that
the data has been
Could any one of a million things. Does the JSP app not display this
behavior on other app servers?
Last time I saw this happen, the developer forgot to write code to close
JDBC connections each time he opened them. So after a while, the database
connection pool was getting used up and
Anybody know how to make Tomcat (3.x or 4) use Jikes for compiling JSP's?
Also, is there an easy way to precompile JSP's using Tomcat?
thanks-
jmc
===
To unsubscribe: mailto [EMAIL PROTECTED] with body: signoff
From what I remember, use JAXP to parse the XML document and return an
org.w3c.dom.Document object, which has a getElementsByTagName(String)
method. That will return a NodeList which is basically an array of nodes.
Not familiar with JAXP? http://www.apache.org/~edwingo/jaxp-faq.html
Javadoc:
Is there a good JSP editor available anywhere to download? Such as MS
Visual
Studio for ASP...
I've heard good things from a coworker about IntelliJ IDEA but haven't had a
chance to try it myself. And there's an article on Orion's site about it
that explains some of its features:
Does anyone know about a tutorial for a beginner of JSP, but has several
years of experience of ASP and VBScript dev.
Hi Henke-
This is probably not what you want to hear, but I've always felt the best
way to learn JSP is to learn Java first and try to forget what you know from
your ASP days.
100 matches
Mail list logo