Win a copy of Java by Comparison (eBook) this week in the Java in General forum!

john smith

Ranch Hand
+ Follow
since Mar 04, 2004
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 john smith

Functionality that is provided in a class's constructor must be implicit to the class - otherwise why define it there? Overload the superclass's constructor in the superclass, that's the only way round this.
14 years ago
Submit the JSP to itself and call use request.getparameter() as you normally would.
14 years ago
JSP
SO you want to define a new class that is of the type of one object, but you don't want that object's functionality? Sounds like you shouldn't be trying to extend the first class at all.
BTW: Are these attributes read only?
14 years ago
If you know your HTML will be well-formed (which unfortunately isn't implicit in HTML) you could just parse it as XML.
You do also have access to the java.util.regex as of JDK1.4 - you'd probably be able to knock something up using this.
14 years ago
Have you tried:
14 years ago
JSP


No Java compiler was found to compile the generated source for the JSP.
This can usually be solved by copying manually $JAVA_HOME/lib/tools.jar from the JDK
to the common/lib directory of the Tomcat server, followed by a Tomcat restart.
If using an alternate Java compiler, please check its installation and access path.


You've tried this and it still doesn't compile?
14 years ago
JSP
From the API javadoc:
14 years ago
You are right that 1 is the best of the three. You should always try to avoid the unecessary round trip involved in 2. 3 sounds like it is complicating things more than it needs to.
Don't use synchronized at all in servlets. Thread management is up to the container. You can get some way to the same behaviour that synchronized would give you by having your servlet implement the (now deprecated) interface javax.servlet.SingleThreadModel. I'd be curious to know why you need this functionality?
14 years ago
new
A class defines the common properties and functionality avaliable to an object. "new" instantiates an instance of a class. What does that mean? It means it constructs an object of the type defined in the class. Suppose you write:

what have you got? You have two instances of the String class. Both have the same functionality avaliable to them, both have the same value, but the are seperate objects in memory.
14 years ago
Use the TO_DATE oracle function. java.sql.Date is seeded from Jan 1, 1970 00:00:00.000 GMT, so you'll not get a date earlier than this.
14 years ago
Displaying the excel sheet is easy enough - just embed the object reference in your HTML. However if you have to build the spreadsheet then display it, this is very awkward. I had a simmilar requirement a few years back and the work involved made it not worthwhile. In the end we used Corda's Popcharts product and ditched Excel all together. Its pretty good for generating graphical displays.
14 years ago
JSP
Other common thing to watch out for are Virus Scanners (particularaly as you only seem to get this with jar files). Try and find out which PIDs are associated with the reference.
14 years ago
No. Array size is fixed at the point of creation. Should you need a list-type collection which can grow, use ArrayList instead.
14 years ago
Servlets do not have constructors - well, not constructors that you can use. Why? Because they are container managed objects, its up to Tomcat (or whatever container you choose) to construct instances of the servlet. You use init() because it represents actions performed during initialization of the servlet, which is different from construction.
14 years ago