Jun 5th 05
Posted by Remus Stratulat in Programming
The chaos theory as it is understood by the physicists is really about finding the underlying order in apparently random data.
But what is the relation with a software project?
Let’s suppose we have a company that is quite large and a software project is done using a certain standard. This standard requires a lot of documents to be written by various people. For example there are documents that describe the interface, documents that describe the database and documents that describe the use case. Everything is nice and proper organized.
Or is it? What dwells under the surface?
Sometimes working in this conditions is putting together the underlying random data beneath the apparently order.
We will dive head first into this in the following articles.
May 23rd 05
Posted by Remus Stratulat in Java
I was developing a master-detail administration module for an ERP at the company I am working now.
So, I finish my task, hand it over to the administration team and start working on the next one.
The next day I have received a bug report that was saying my module did not worked at all. I tested it myself on the deployment server and it was true. I was seeing only a blank page.
I am relatively new to the j2ee / struts development so I did not know what was happening. On my jboss local server everything was working OK, on the Oracle Application Server – blank page.
The worst part for this it was that I did not have rights to make debug on the Oracle. After a day of struggle one colleague enlighten me: it was a “/” missing from the struts-config action’s forward definition.
I had written:
<forward name="default" path="template.jsp?page=erp/...
and it should have been:
<forward name="default" path="/template.jsp?page=erp/...
Not very smart of me…
Mar 31st 05
Posted by Remus Stratulat in Java
Struts was using two different classes to report errors and messages back to the user: ActionErrors and ActionMessages. As the ActionErrors and ActionError classes were deprecated since 1.2.0. version I will talk now only about ActionMessages and ActionMessage.
From an action class when you need to send a message to the page all that must be done is to set it up using the ActionMessages class.
Struts ActionMessages example:
ActionMessages actionMessages = new ActionMessages();
actionMessages.add(ActionMessages.GLOBAL_MESSAGE,
new ActionMessage("my.error"));
saveMessages(request, actionMessages);
This error will be displayed in JSP using:
<logic:messagesPresent message="true">
<html:messages message="true" id="msg">
<bean:write name="msg" ignore="true"/>
</html:messages>
</logic:messagesPresent>
One issue to be mentioned here is that “my.error” is a key that will be used to look up message text in an appropriate message resources database, like Application.properties for example.
But if you do not need to report a generic error message you will have to use the following code:
ActionMessages actionMessages = new ActionMessages();
actionMessages.add(ActionMessages.GLOBAL_MESSAGE,
new ActionMessage("my.error"));
request.setAttribute("warnings", actionMessages);
This code will set up an error message under an arbitrary key and display it with the html:messages tag:
<html:messages name="warnings" id="message">
<bean:write name="message" />
</html:messages>
There are some differences to be noticed here.
- There is no message=”true” attribute present that signals to look up for an ActionMessage under the Globals.MESSAGE_KEY.
- There is no <logic:messagePresent> tag as it will not be validated.
If your error message gets constructed dynamically the ActionMessage class offers four constructors that allow message customization with up to four parameters.
So the message:
new ActionMessage("my.error", "p1", "p2", "p3", "p4")
where
my.error=You are not allowed to do {0}, {1}, {2} and {3}
will render
You are not allowed to do p1, p2, p3 and p4
Mar 22nd 05
Posted by Remus Stratulat in Java
I am developing an application using JBoss as a deployment server. After a redeploy the JBoss throws an error on me: org.jboss.deployment.DeploymentException: Connection refused: connect
The problem was in jboss.xml file:
<!DOCTYPE jboss PUBLIC
"-//JBoss//DTD JBOSS3.2//EN"
"http://localhost/jbossdtd/jboss_3_2.dtd">
After I have changed this to:
<!DOCTYPE jboss PUBLIC
"-//JBoss//DTD JBOSS 3.2//EN"
"http://www.jboss.org/j2ee/dtd/jboss_3_2.dtd">
everything has gone smoothly.
Mar 17th 05
Posted by Remus Stratulat in Java
I found myself the other day in a strange position developing a project on JBoss.
The project was based on Struts and after deployment it didn’t worked. The symptoms were this: the landing page was not updated to the version of the deployed project. Instead the browser was showing to me a page from a previous Struts based project.
After I sniff around on the Internet I found no solution to my problem
. So I did it the hard way.
I start searching for a pattern in the JBoss behavior and I found that it cached all the files that were common between the two projects. That was because the last project was from CVS and had all the sources older then the first project I was working with. So I modified the index.jsp and after loading it into the browser (and sow it was the correct one) I’ve start to search on my hard drive all the files not older than 10 minutes. And there it was
, c:\tmp\project_name\index_jsp.java.
So after I’ve deleted c:\tmp\project_name directory everything gone back to normal.
Mar 14th 05
Posted by Remus Stratulat in Java
Well, Struts uses the Model-View-Control Model 2 approach.
There is only one difference between Model 1 and Model 2, Model 2 architecture introduces a controller servlet between the browser and the JSP pages. And that is all.
Mar 7th 05
Posted by Remus Stratulat in Java
I have started to learn Struts which is an open source framework for building web applications. There are some nice features in this framework and I am trying now to get a hold on them.
There are more frameworks out there in the Internet realm, some better then others. Here are some of them that I know:
For sure there are a lot more frameworks but this four are the ones I know. I will return with more on this subject.
Mar 4th 05
Posted by Remus Stratulat in Java
Today I am reentering into the Java world.
I have changed my workplace. It has been nice and fun to work for InterAKT and to develop Dreamweaver extensions as I believe that I helped the company become the best in this market. The experience gained there was great. I have learned new technologies and I have become a better person, better team mate as I have polished my people skills under the tutor of some great colleagues.
But the time has come to return to the technology I like most: Java.
Nov 4th 04
Posted by Remus Stratulat in 2004
It’s 2:30 PM and I’m at the Community Pit. Only few are here as this last day of MAX is filled only with sessions.
We just had a “work” lunch with Randy from Macromedia. The discussions were so insightful as after an hour or so we found ourselves alone in the dining room.
I think the conference was a great success. A lot of people visit our booth (we will carry no promotional materials back home) and we made a lot of connections. We meet with customers and they were all satisfied with our products.
I meet here Kai Konig. He was a real help to me and to all of us as he give us some useful informations on how to become a Premier Partner (his company is one). First step will be to get some Macromedia certifications, so Lucian and I will start learning to get those certifications. Kai show us two very good books that help him in his study and with his recommendations we bought them.
Nov 2nd 04
Posted by Remus Stratulat in 2004
Today is the second day of the conference. We got up early and arrived here at 7:30 for a short breakfast. Now we are all sitting at the community pit working on our laptops. I’m writing this blog and Alexandru is preparing his tonight session.
Yesterday the conference started late in the evening. We loose all our day preparing the booth, the folders and flayers and the product boxes. When the conference finally started a lot of people come to our booth. For the user groups managers we have prepared the boxed MX Kollection and wen the word got out a lot of them came to our booth an we almost finish all the boxes.
Other people came to our asking about the products. They were very interested in MX Kollection and a special atention was captured by KTML. We are all pleased the way first day presented. Now we are looking forward at the current day that is due to start in a short time.