Ben J. Christensen

Example of Manually Doing a GZIP HTTP Request

GET /inQuireWeb/pages/home.jsp HTTP/1.1
Host: inquire.etilize.com
Connection: close
Accept-Encoding: gzip
Accept: text/xml,application/xml,application/xhtml+xml,text/html;
Accept-Language: en-us,en;q=0.5
Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7

Filed under: Code

Databases in appserver environments …

Jisql is the only way to survive in a server environment — on a server with no client access to the db, except for the app you’re trying to debug …

Use Jisql from the command line :-)

Filed under: Code

Add All New Files with SVN

Add this to .bash_profile for a quick command line for adding all new files in a working directory.

svn_add_all(){
svn status | grep “^?” | awk ‘{print $2}’ | xargs svn add
}

Filed under: Code

Multithreaded in Javascript

http://www.onjava.com/lpt/a/6539

Filed under: Code, User Interface

JBoss and session persistence

JBoss 4.0.3 by default has session persistence turned off.

JBoss WIKI

the context.xml file:

# pwd
/apps/jboss/server/default/deploy/jbossweb-tomcat55.sar
# more context.xml

org.jboss.web.tomcat.security.RunAsListener

Filed under: Code

J2EE Security in JBoss

In the login-config.xml file

<application-policy name = “VTNSite”>
<authentication>

<login-module code=”org.jboss.security.auth.spi.UsersRolesLoginModule” flag = “required”>

<module-option name=”usersProperties”>props/console-users.properties</module-option>

<module-option name=”rolesProperties”>props/console-roles.properties</module-option>

</login-module>

</authentication>
</application-policy>

/server/default/conf/props> more console-roles.properties
# A sample roles.properties file for use with the UsersRolesLoginModule
admin=VTNSysAdmin

/server/default/conf/props> more console-users.properties
# A sample users.properties file for use with the UsersRolesLoginModule
admin=mypassword

Filed under: Code

Prototype Documentation

http://www.sergiopereira.com/articles/prototype.js.html

Filed under: Code

Order by with Row limit in Oracle

http://www.sleberknight.com:8080/roller/page/sleberkn/20050714

———–

select * from person where last_name = ‘Smith’ and rownum
When you run that query, you find much different results than you expect. This is because Oracle performs the query and applies the rownum to each row in the results before applying the order by clause. So the question is how in the world do you use Oracle’s rownum in concert with an order by clause and get the correct results. I cheated. I have been using Hibernate for a while on an Oracle database and know it is able to handle this exact situation – that is, limiting the number of results and applying an order by clause to a query. So I set the hibernate.show_sql property to true and looked at what it generated for a query. It turns out to be very simple and makes use of a subselect:

select * from (
select * from person where last_name = ‘Smith’ order by last_name, first_name
)
where rownum

Filed under: Code

JSTL: List Sizes

This link is useful for getting list sizes etc using JSTL:

http://forum.java.sun.com/thread.jspa?threadID=484828&messageID=3731101

Here is the piece for testing a certain size:

<c:if test=“${osms[1] ne null}”>

And if using JSTL 1.1 to get the size:

<c:if test=“${fn:length(list) > 1}”>

Filed under: Code

More cool AJAX links …

On the Prototype website there are already links to these sites, but
they’re worth noting … I haven’t used them yet but likely will.

http://script.aculo.us/

http://openrico.org/rico/home.page

This e-mail is privileged, confidential and subject to copyright. Any unauthorised use or disclosure of its contents is prohibited.

Filed under: Code, User Interface

Twitter Updates

View Ben Christensen's profile on LinkedIn
Follow

Get every new post delivered to your Inbox.