Archive for the ‘web development’ Category

Adding an Icon to Your Website

Wednesday, July 22nd, 2009

Here is how you can add an icon to your website – or actually to all the pages on your site. First of all you will need to find an image and convert it to the .ico format. I’ve used http://www.html-kit.com/favicon/ as an online tool to do that. Save icon image on your site and have pages refer to it with the following head segment:
<head>
….
<link rel=”shortcut icon” href=”_path_to_your_icon_.ico” >
</head>
And that’s it. Now I need to find a good icon for my sites 🙂

Configuring a web server instance with JBoss

Friday, July 4th, 2008

It is not hard to configure a jboss web server instance on the same machine with other instances. You might want to look at http://wiki.jboss.org/wiki/ConfiguringMultipleJBossInstancesOnOneMachine for explanation on why would you need it. To create a server instance copy default directory in jboss-xyz/server (or minimal if you are certain minimal server will do for you) and name it say my-webapp.  Go to your bin directory and copy run.bat (run.sh) and change the line:
“%JAVA%” %JAVA_OPTS% “-Djava.endorsed.dirs=%JBOSS_ENDORSED_DIRS%” -classpath “%JBOSS_CLASSPATH%” org.jboss.Main %*
to:
“%JAVA%” %JAVA_OPTS% “-Djava.endorsed.dirs=%JBOSS_ENDORSED_DIRS%” -classpath “%JBOSS_CLASSPATH%” org.jboss.Main -c my-webapp  %*

You might also have a -b option with your host name, like -b localhost as described in the article above. Now you also want you website to be on different port, not port 8080. To change the port, go to my-webapp/deploy/jbossweb-tomcatx.sar directory and change the ports there.

How to work with checkboxes in Spring MVC

Thursday, June 26th, 2008

The usual problem with checkboxes in web environment is that if they were checked when you  are rendering the page and user unchecks them, there is no way by default to know that on back end. This is especially true when you are working with the ‘form’ for Spring wizard, since formBackingObject, where you can reset the checkbox boolean values to false,  is only called once for the first page and not on the subsequent pages. Spring MVC has a better solution to this problem, buy using the following construct:

<spring:bind path="command.myBooleanProperty"> 
        <input type="hidden" name="_<c:out value="${status.expression}"/>">
        <input type="checkbox" name="<c:out value="${status.expression}"/>" value="true"
            <c:if test="${status.value}">checked</c:if>/>
</spring:bind>

This approach is discussed on http://forum.springframework.org/archive/index.php/t-16093.html and on http://opensource.atlassian.com/confluence/spring/display/DISC/Working+with+Checkboxes

How to Host a Web Server at Home With Dynamic DNS

Friday, June 6th, 2008

A good article by  Jeff Black oh how to host a web server at home could be found at http://codebeneath.blogspot.com/2007/08/how-to-host-web-server-at-home-with.html In my case, I’ m trying to find a good service that would host my web-apps and would not be too expensive – so I might try his approach.

Finding appropriate colors for your site and for development

Monday, June 2nd, 2008

It is much easier to choose the background or foreground colors for your site with a visual map of colors. One of the maps could be found at: http://i105.photobucket.com/albums/m210/royaladybug/RL_Site/colorchart.gif. Colors I’ve used for background are light pastel colors #CCFF66, #CCFFFF, #CCFFCC, #FFFF99, #99FFFF, #99FF99, #CCCC99, #CCCCFF, #CCCCCC, #CC99FF, #FF99FF,#66CCFF which work really well with black foreground color. The best way of course is to use CSS to define you background colors. So for example for tables cells I’ve used the following format:
in css file td.bgcolor1 { background-color: #CCFF66 } in jsp file: <td class="bgcolor1">. You can choose a better description for colors or have css refer to functional elements on your site.