Arquivo do Autor

Lets say you have an Action that lists some items. And you have another action that adds items.

If you add an Item you can either just show a “blank” with the “All ok with addition” or even smarter is to use the ListAction. But how do you give feedback to the user that the addition was ok? Simple you just addActionMessage(“Item added ok”); on the first action and the message will be rendered by the s:actionmessage in the jsp of the second. Right? Wrong!!
Struts will “eat” ActionMessages and ActionErrors between the first and second action. But Glindholm solved the problem with a simple Interceptor.

Comments Sem Comentários »

If you like IDEA and use Struts 2 you can be happy to know that 8.0 release comes with a new Struts 2 plugin. There is a small tutorial on how to use it but it has some errors.
First the Action class should extend ActionSupport hand have proper setter methods:

package hello;
import com.opensymphony.xwork2.ActionSupport;
public class HelloWorld extends ActionSupport {
    private String username;
    private String message;
    public String getMessage(){
        return message;
    }
    public String execute(){
        message = "Hello, " + username + ".";
        return SUCCESS;
    }
    public String getUsername() {
        return username;
    }
    public void setUsername(String username) {
        this.username = username;
    }
}

Second the JSP file can have a proper action:

< %@ page contentType="text/html;charset=UTF-8" language="java" %>
< %@ taglib prefix="s" uri="/struts-tags" %>
<html>
  <head><title>Simple jsp page</title></head>
  <body>
		Struts 2 Message: <s :property value="message" default="Guest." />
		<s :form method="GET" action="HelloWorld">
			Enter your name:<s :textfield name="username" />
			<s :submit value="Submit" />
		</s>
  </body>
</html>

And finally struts.xml can have the Action declared without the ugly unRESTFUL .action:

< ?xml version="1.0" encoding="UTF-8"?>
 
< !DOCTYPE struts PUBLIC
  "-//Apache Software Foundation//DTD Struts Configuration 2.0//EN"
  "http://struts.apache.org/dtds/struts-2.0.dtd">
 
<struts>
    <package name="/" extends="struts-default">
		<action name="HelloWorld" class="hello.HelloWorld">
			<result name="success">/index.jsp</result>
		</action>
	</package>
</struts>

I really like IDEA when it comes to Java codding, and I can live with the quirks of the Struts 2 support. But one thing that makes me steam is the fact that I have to un-deploy and deploy the application for each change I make. That steals me hours every week.

Comments Sem Comentários »

I have not fallen and bought an iphone. Just testing one and a Rss reader and blog posting tool.

Comments 4 Comentários »

There is a magic that is not possible to describe.

Comments 3 Comentários »

The jPod book by Douglas Coupland is probably one of the most hilarious things I’ve read in the last few years. It is a fairly accurate picture of Pop-Geek culture (minus the homicidal, drug dealer mom and the homicidal, white meat smuggler friend).

If you have the chance get a copy and read it. You’ll love it.

My copy is going to be dropped in some bookcrossing site somewhere in Coimbra… Search for it :)

Comments 4 Comentários »

A new life is in the process. The joy of looking at a small paper with a tiny bean that is part of me is overwhelming.

Raquel told me that even with this small size she could hear the tiny human being hearts beating fast. Next time I’ll go and no matter what I’ll get to listen to it to.

Ecografia 7 Semanas

Ecografia 7 Semanas

42 ? 42 is not the answer. Life is the answer.

Comments Sem Comentários »

Thunderbird was behaving strangely today not showing messages when I clicked them. I tried to close it and open it a couple of times but nothing happened.

I selected the compress folder option and now my mail from 2003 till now is gone!!!!!

Sad sad sad day. Really sad indeed.

Comments Sem Comentários »

Comments Sem Comentários »

Dia 14 de Junho de 2008. É meio dia. Estou na Sé Nova de Coimbra à tua espera. Estamos a preparar este momento há dois anos e meio. Desde que nos vimos que soubemos que aqui iríamos chegar.

Estou junto ao altar de uma igreja, estou aqui à espera de pé. Estão centenas de pessoas a olhar para mim. Estão todos a pensar: “Olha para a carinha dele, está tão nervoso a pensar que ela não vem!” – Não estou nada! Claro que ela vem. Se estou assim com cara estranha é de estar toda a gente a olhar para mim.

Estamos a dar um passo. Estamos a dar o passo. Estamos a formar uma família.

Sim aceito.

Desculpa o clichê que se segue Raquel. Fazes de mim um homem melhor. Espero que sintas o mesmo e que possamos continuar assim.

Comments 1 Comentário »

The guid to cats that we all were waiting for.

Comments 3 Comentários »

Sometimes a problem has a complex solution. Others the smart solution is just around the corner.
xkcd 399

Comments Sem Comentários »

For some days now Skype has released a new public release that has video support. Since day 0 the Gentoo users that were running the testing version could have an upgrade. A few more weeks and if no strange bugs pop up it will be marked as stable software.

So if you are still running the old skype and want to use the new one:

emerge --sync
echo "net-im/skype" >> /etc/portage/package.keywords
emerge skype

Comments Sem Comentários »

All in all there's something to give,
All in all there's something to do,
All in all there's something to live,
With you ...

14-06-2008

Comments 1 Comentário »

Paula Simões did a reply on the previous post about second life. Go read it as it is quite good and them come back for my re-replys.

Paula: You fail to point a single source of real revenue, the one that is capable of generating more revenue. You are counting on universities to keep pouring cash into the system? That is the worst Business Model ever.
And even believing that Universities would continue giving SL money because it saves them elsewhere:

One of the best advantages of SL is simulation. There are many examples, taken from several Universities: Law students practicing in a court room; medicine students practicing with virtual patients; students creating architecture models; etc.

I can barely agree with the first one, but the others? Architecture models? Medicine students practicing on a model? SL is a poor excuse for a simulated 3D world. The 3rd person perspective kills any lessons one might learn for architecture purposes. Just try to design a real house in SL and you end up walking over every peace of furniture there. And practicing a delicate surgery in a virtual model? Maybe practicing the theoretical steps would be possible but more than that?

Why would a company want to be on SL? That is the real issue. Find a BM that is capable of generating real revenue and maybe we can find a common ground. Until them, for me, it is just a souped up academic experiment.

Comments 7 Comentários »

A few weeks ago I attended some presentations about social 3d worlds. Two of the four presentations were about what can be done on Second Life and how to do it, another was about E-Learning and Virtual Worlds and the last one (actually it was the third) was by Marcos Marado and was a very nice retrospective about virtual worlds dating back to 1968. His presentation showed that many of these virtual worlds was eventually taken over my something newer. Surely many are still used today, but the user base dropped to a shadow of what was before.

My feeling is that the same will happen to second life. And why will that happen? Today I see two classes of problems with second life that need addressing:
Technical Problems
It is a very slow engine! It is open source code so the community should be able to fix it right? Wrong!! The problem is at a level that I do not believe a fix can be produced by changing the client code. As I saw last Saturday most of the performance issues come from the fact that the engine was designed to parse user produced content.

Economical Problems
Second Life is not a game. It does not aim to be a game. It aims to be a simulation of the real world, and it wants to be as perfect as possible. So good a simulation that money inside the virtual world is bought with real €€ and can be converted back.

Second life is an emerging platform for content production and distribution, just like the web was in 95. The main difference is the cost involved in a web presence versus a second life presence. Also back in 95/96 it was easy to imagine why should company A or B be in the web. With second life it is not that easy.

Comments 1 Comentário »

The company I work for (WIT-Software) launched it’s new corporate identity a few days ago. The new web site is up since…… some 15 minutes ago :) .

WIT-Software

I hope you all like the new logo and image.

Comments 8 Comentários »

This is just a pointer to my guide about Gentoo on the Dell D630.

Comments Sem Comentários »

I’ve been trying to stress test a RTSP Streaming server. My goal is to see how many clients a particular server can handle. Apple has a tool called StreamingLoadTool, but virtually no information on it, also it crashes alot with:

ClientSession: Failed to bind a UDP socket.

after running for some time.

All other tools I saw where commercial windows based multi purpose test tools that would need a giant test farm.

Comments 1 Comentário »

With XCB and java graphical applications on recent distributions one gets:

java: xcb_xlib.c:82: xcb_xlib_unlock: Assertion `c->xlib.lock’ failed.

This is very well documented (just google a bit). So this serves mostly as a mental note for the way to fix it.

$ sed -i ‘s/XINERAMA/FAKEEXTN/g’ /opt/sun-jdk-1.6.0.04/jre/lib/i386/xawt/libmawt.so

or the libawt.so of your JRE. Remember that many programs may come with they’re own JRE and not use the one provided by the system.

Comments 1 Comentário »

Clear winner :)

Comments 2 Comentários »