Research Log of Web Science Students

Computer Science is not simply programming

Posts Tagged ‘JSP

Issue 4: Spring MVC + GWT + JSP

leave a comment »

From our wiki page,

ISSUE: Project Form Specification 6 and 7 – which loads first jsp or javascript?

Spec 6: module title will be in a hidden form field, retrieved by GWT, and displayed using GWT.

Spec 7: module learning activities will be comma separated in a hidden div or form field and displayed using GWT.

The solution to our Create a Project Feature requires the collaboration between the controller and the javascript (done with GWT). When a user wants to learn a course, he/she clicks that course and it sends the id to the controller. Controller gets the course from the database and generates a form that will allow the learner to add as many learning objects as he/she wants. The javascript displays all the learning activities of the course where the user adds learning objects.

But where does it get these from? The controller places the course details in a hidden input field. GWT retrieves this data, and layouts the form for us. Hence, our problem, will the jsp be able to print all the learning activities in the hidden input field before gwt tries to retrieve them?

I was afraid javascript would load first. Theoretically though I thought not. PHP is interpreted and returned with no more PHP tags, that’s why when we view-source a .php webpage, there’s only html in it and no more php. Why shouldn’t the same apply to jsp? Different design perhaps. I had to find out. I first went to my JSP and Servlets bible and looked for answers so I wouldn’t have to do an experiment. But because I was confident JSP is interpreted on the server like PHP is (and because I also wanted to code), I just did an experiment.

To cut the long story short, I never found out what happens on the server when you request for a jsp but I do one thing, jsp loads first before gwt can do it’s thing.

Advertisements

Written by Jose Asuncion

November 28, 2009 at 6:02 pm

Posted in Hardwire

Tagged with , , ,

Introducing Drop.io

with 2 comments

I must say it is REALLY HARD (note: ALL CAPS) to look for an online repository that is free, has an open API, good support, and an active user base. Good thing I discovered Drop.io (which I hope to be my last pitstop in my race (search) for a repository for Projectrix.)

Simply put, Drop.io is like the Bit.ly of file sharing–upload your files, and it will create a short URL (customizable) of your files. Pretty neat, eh?

Here’s a rundown of what I like (and kinda not like) about Drop.io:

It’s API Client is in Javascript

– That means all I need to do is to include the script in the JSP file–I won’t have to deal with the Spring MVC for a bit.

    <html>
      <head>
          <script type="text/javascript" src="[PATH TO THE API CLIENT]"></script>
      </head>
      <body>
        <script>
           var api = new DropioApiClient("[YOUR API KEY]","[FULL PATH TO YOUR XD RECEIVER PAGE]");
           // do stuff with the api here
        </script>
      </body>
    </html>

You are allowed to do 2000 API calls from your given API key

– While this may actually be a downside, for student researchers like us, this is a fair deal. We can do an upgrade anyway once this gets deployed.

It’s secure

– A concern raised by Jeune after learning that the API key will be hard coded in the javascript file is security. Turns out the API key will only be used to track the third party application and check if it is a legitimate one. Creation of each “drop” (that’s how they call your uploads) given the following code will return a token (a.k.a. a session key – Jeune).

var api = new DropioApiClient("[YOUR API KEY]");
    api.createDrop({name:"somedrop",privacy_type:"VIEW"},receive_response);
    function receive_response(response,success) {
      if( success )
        alert("Your drop is: " + response.name);
      else
        alert("Error creating drop: " + response.message);
    };

Maximum upload life is 1 year

– While we can store ratings in Projectrix forever, we cannot do anything about this–the least for now.

The files are not crawlable [sic]

– This is not of our concern as the ratings in Projectrix is what we want to be crawled on. [sic]

Wide and active user base and support groups

– Development of Drop.io, and third party applications that make use of it are growing (and are very active). Therefore, there’s a growing number of people who can help us out.

Written by falloutkee

October 5, 2009 at 2:01 pm

Everything Needs Getting Used To

leave a comment »

Even web development under Java. Well, I’m enjoying JSP since it’s full of tags, but the behind-the-scenes work (i.e. packages, classes, and what-not) still manages to confuse me.

Written by Paolo Sy

September 15, 2009 at 10:31 pm

Posted in Hardwire

Tagged with , , ,