Research Log of Web Science Students

Computer Science is not simply programming

Still making mistakes but still learning till now

with 2 comments

I have been using the Spring framework ever since thesis started. I also recommended the same to Projecrix and I am still helping the latter till now. I have roughed through a feature in the past that required a lot of learning of the Spring framework (see here, here, here . And today I found myself going through the same path.

I thought it would be a cakewalk.

But I was wrong.

I wanted to create a form using Spring forms just like before but with a twist prepopulate the form with values. Just in case you didn’t recognize, these are the values of a project’s url and title from Hardwire!

So I experimented a little bit with Spring SimpleFormController‘s formBackingObject() method.

Using the formBackingObject method I am able to populate my form fields with values. To cut the long story short, I wasn’t able to make it work. So I had to let go of my pride for now and just do a brute force implementation.

Which I did and it’s working but I hate it…a bit.

The database was already populated with a project from Hardwire. I did this manually by making my “calls” via the browser url box. I got the response and now it lets a user have his project assessed:

I Still have to change the url to meet the one specified in the REST protocol of Projectrix

Another good thing I learned today: I didn’t have to implement another security filter for this feature. I simply had to specify it declartively in the xml!

		<filter-name>The Filter I Made</filter-name>
		<url-pattern>Url to assessments</url-pattern>
		<url-pattern>Url to projects</url-pattern>

I couldn’t believe it was that easy. But it could have been worse had I not decoupled the filters and controllers that make this whole thing work.

We’re almost there and I am going back to Hardwire now to call Projectrix’s web service! 😀


Written by Jose Asuncion

January 8, 2010 at 3:23 am

Posted in Hardwire, ProjectriX

2 Responses

Subscribe to comments with RSS.

  1. […] feature makes use of the Spring forms I made last […]

  2. […] a comment » In a previous post I was grappling with Spring Simple Form Controller’s formBackingObject() […]

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

%d bloggers like this: