I'm using weblogic locally to test my servlets before i deploy them. Weblogic (fortunately) is also a Java-application which i execute with the -Xmsn option to increase the initial memory usage (This also includes the memory usage for the servlets).
The only sugestion that i can give you is to...
have you tried to run the program with the -Xmsn option. A possible option can be -Xm48M, then you start with a minimum memory space of 48M.
Perhaps this helps,
Steven.
I think that the problem is that you use
<% =myJSP %> instead of
<%= myJSP %>.
The difference between those two is that the first JSP code is copied directly into the servlet that is generated and tries to perform the statement ' =myJSP'. The second statement prints the value of the variable...
I tried a similar simulation myself and it worked for me. It's possible that you've narrowed the Exception to hard or ask for an other exception than that is thrown.
Try to include all the exceptions that are thrown in the second try/catch block (for instance, the NullPointerException can also...
try this in instead:
if(request.getParameter("budget") != null)
myObj.Myfloat = Float.parseFloat(request.getParameter("budget"));
Hope this helps,
Steven.
perhaps you can use this:
try
{
accum += Float.parseFloat(textbox.getText());
}
catch(NumberFormatException)
{
System.out.println("No real float in textbox");
}
textbox.setText(""+accum); //instant conversion from float to String
Hope this helps,
Steven.
if the float in your object is of type Float then you can use
(myObj.Myfloat == null)
but if you use the primitive float, you can't compare it to null. There i would recommend the NaN value as initialisation and comparing.
Hope this helps,
Steven.
No parseInt() and intValue() are not the same.
- intValue() returns the int value represented by that Object (in your case a Integer).
- parseInt(String s) returns the int represented by the string. This string must be only decimals. only the first character can be a '-'.
Hope this helps,
Steven.
As far as i read in the java doc, the # defines that the value can be absent. If you'll use the pattern "0.000" will be convert 5,0 -> 5,000.
Hope this helps,
Steven.
Here is the solution from Borland:
These errors happen because the Java Virtual Machine (JVM) that is running JBuilder can't find a font that has been specified.
The font that the JVM is looking for is "symbol.ttf". This font should be available on any Windows machine. You need to...
If it's only about strings that you want to use then you can use java.util.Properties. It extends Hashtable and has also the functions load and store, which provide the functionality for you.
If it's about object's you'll have to write the function's yourself.
Hope this helps,
Steven.
Sorry for this late reply, but i was on a needed vacation for a long weekend.
I've tested the fnuction myself in a servlet and it creates a .csv file in the root of the webserver. Can you send me your servlet so that i can see what the possible problem is?
Greetings,
Steven.
Hi, here is a little function that i just made. The only thing that you have to do is to create the FileWriter for the csv and catch the exceptions.
private static void writeResultSet(ResultSet resultSet, Writer output)
throws SQLException, IOException
{
int cols =...
Before i forget, if you want to manipulate the array, you also can look to java.util.Arrays.
This class contains some functions for manipulating mainly primitive arrays.
Greetings,
Steven.
That depends on how you access it. To control the index of the array, you can use it within a for-loop, like
for(int index = 0; index < array.length; index++)
{
//do something with array[index];
}
But if you supply for example array[2] to a function, you'll loose the array, but get the...
As far as i can see the error that you get is the undefined variable on radiob1. This will be solved if you declare the buttons global in your code.
// global declaration of the buttons and other stuff
private JRadioButton radiob1;
private JRadioButton radiob2;
private ButtonGroup radiogroup...
You can look at the use of "wait, notify, notifyAll". These work together as semaphores. The following code example is from the Java tutorial. It shows a little of how it's used with a producer/consumer combination.
public synchronized int get() {
while (available == false) {...
For directly processing a file you can use java.io.RandomAccessFile. This class supports both reading and writing without having to open a separate Reader and Writer. This class also has a readLine function that returns Strings. Perhaps this is a solution for you.
Greetings,
Steven.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.