Help coderanch get a
new server
by contributing to the fundraiser

Jose Zaleta

Greenhorn
+ Follow
since Mar 04, 2004
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 Jose Zaleta

As I user the only "disadvantage" you might get from using a POST request is that the user may not cache the result.

To summarize:

As Adeel was saying, that's why GET is used in operations that don't really affect the state of an application (like queries), and POST is.

When using GET some browsers and/or servers may limit the quantity of data you can send in the query string. With POST, an advantage is that this limit does not exist.

Both GET and POST are HTTP requests. When the user clicks the link or submit button, a NEW connection will be used to make the request for both cases. So both will have a similar performance. A way to "optimize" this is to use HTTP 1.1 that can make a more efficient use of connections by keeping the same one alive to perform the requested HTTP operation.
19 years ago
JSP
Hello Andy,

I don't quite get the issue here. Before trying the j_security_check, did you try the web page? Did you see the images then?

A good approach is to link images with the whole path like:
/<context-path>/<img-location>
like:
/javaranch/img/sample.gif

How are you making this references?
19 years ago
JSP
About doing what Chris proposed, in you web.xml file:
...</servlet-mapping>
<session-config>
<session-timeout>5</session-timeout>
</session-config>
<mime-mapping>...

Here the 5 equals 5 minutes of session inactivity.
20 years ago
Besides your digital certificate and properly configured web server with an https port, you can use an struts extension called sslext.

Check: http://sslext.sourceforge.net/

You can define security configuration on a per page basis, just like this:
<%@ taglib uri="/WEB-INF/sslext.tld" prefix="sslext"%>
<sslext ageScheme secure="true"/>

And you configure which port to use in your struts-config.xml:
<plug-in className="org.apache.struts.action.SecurePlugIn">
<set-property property="httpPort" value="80" />
<set-property property="httpsPort" value="443" />
<set-property property="enable" value="true" />
</plug-in>

If an http request comes in and the page secure attribute is set to true, it will automatically be redirected to the https port.

Let me know if you need any futher assistance.
20 years ago
Jay,

I've just tried your formatting code in a regular java application. The problems seems to be this: You are trying to format numbers represented as String objects. DecimalFormat does not allow for this input, it requires Number objects.

This means:
DecimalFormat formatter = new DecimalFormat("#,000.00");
System.out.println(formatter.format(new Double("55555")));
will work, and what you are doing is equivalent to:
DecimalFormat formatter = new DecimalFormat("#,000.00");
System.out.println(formatter.format("55555"));
which throws an Exception.

You should then try to fill your ArrayList with Double objects, instead of String objects.

Let me know if this helped you out.
20 years ago
Hello Nosaku,
I found some reference in a SUN forum that says that SUN has a problem (bug) when using log4j. The way I solved it was putting the log4j.jar in the server's classpath EXPLICITLY.
I hope this helps. Good luck.
20 years ago
An option for having a web page self refresh itself is the HTML REFRESH meta tag, here's the code:

<meta http-equiv="refresh" content="2;url=http://your.url.com/">
2 is the number of seconds until the page is redirected.
The url is the url that will be loaded.
20 years ago
Hey,
I've used JavaScript to create cookies and used them back in a Servlet later on. Are you sure the cookie is being created? You can check the browser's cache, or if you're using Netscape there's a nice utility that can provide this info.
20 years ago
Here's a sample code on what you want. Hope it helps. Good luck.
<%
String strLinkOpen = "<A HREF=\"B.jsp?StudNumber=";
String strLinkClose = "</A>";
for(int i=0;i<array.length;i++) {
out.println(strLinkOpen + abc.getStudentNumber() + "\">" +
abc.getStudentName(array[i])+ "</A>" + abc.getStudentDepartment(array[i])));
}
%>
20 years ago
JSP
Leandro,
You can find a very useful comparison matrix and list price reference at:
http://www.theserverside.com/reviews/matrix.jsp
I did some reasearch on the subject, so feel free to keep on posting if you have a more specific question.
Best of lucks.
20 years ago
I'm not sure if this will help.
It turns out that S1AS has a bug using log4j in applications. It can be solved by adding the log4j.jar at [S1AS-install]/share/lib and adding the entry to the server's classpath in the admin console.
Let me know if it did help.
20 years ago
It's not much of a solution, but SUN's website says that the product is only certified to run in Linux RedHat 7.2.
I even tried to run it in higher versions of Redhat and it wouldn't work.
20 years ago
I'm not sure if this will help.
It turns out that S1AS has a bug using log4j in applications. It can be solved by adding the log4j.jar at [S1AS-install]/share/lib and adding the entry to the server's classpath in the admin console.
Let me know if it did help.
20 years ago