Web programming

Units WEB1P and WEB2P

Exam feedback 2008-2009 semester 1

Q1 - JPA fragment

Only a couple of people answered this question.

Sketching code was very poor - the signature for the validate method was easily determinable from the fragment but people failed to notice.

Q2 - HTTP protocol

Nearly everybody attempted this question.

Answers generally showed reasonable knowledge, but a common error was to confuse the GET and POST methods with the ability to pass parameters in the query string and the body. It was the latter that the question was about.

Several people got the logic of safe and idempotent the wrong way round. It is not the case that the GET method is safe and idempotent; it is that if the operation that you are performing is safe and idempotent, then you should use the GET method.

Q3 - Simple servlet

The majority of people answered this question.

Common faults were an inability to specify precisely how the document content type is conveyed to the browser (through an HTTP header). Most people knew the name of the servlet method that calls doGet (service), but failed to adequately explain when it would be called (when the servlet is asked to process a GET HTTP request).

The final part of the question was designed to reward people who had bothered to look at the APIs for the servlet classes (particularly ServletContext). Only a few people apparently had.

Q4 - Servlets and JSPs

About half the class attempted this question.

The answers to the difference between forwarding, including and redirecting were generally pretty accurate. However, answers to the part about expressions versus expression language did not always point out that expressions were one of the parts of JSP that made JSP pages not XML-compliant.

The main purpose of tag libraries is reuse, but not many people realised that.

Q5 - Structuring web applications

Nearly everybody attempted this question.

Most people made a reasonable stab at the distinctions between the presentation, business and persistence layers, and about the elements of MVC. However, it was remarkable how poorly everybody did on the second part which asked you to categorise various component functions. Nobody scored 7 out of 7 for that.

Q6 - Javascript fragment

A few people answered this.

The common faults were all fundamental failures in understanding. Answers which merely translated into words the code statements did not reveal any understanding of what the code was meant to do. That's fine if you want to get a job as a human computer, but not if you want to be a computer programmer!

Q7 - Dynamic HTML

Nobody attempted this question.

Q8 - Linking to databases

A majority of people attempted this question.

Why are databases preferred to simple files? It can't be because of speed/ease of access, since databases store their data in files like everyone has to! It's what's provided on top of the storage that counts - facilities like structure, transactions, concurrent access, integrity were what I was looking for.

In the part about connection pooling, everybody should have used the word latency - nobody (I think) did!

There were few good answers to why DataSource is preferable to DeviceManager. There is plenty of discussion in the JDBC literature to explain why.

The strongest arguments in favour of use of the JSTL SQL tags centered around quick report generation. I think only one or two people pointed out that they break the advantages of MVC.

Finally, Hibernate is popular because it specifies an object-relational mapping and effectively gives persistence for free. Not many people said that clearly.


Last updated by Prof Jim Briggs of the School of Computing at the University of Portsmouth

The web programming units include some material that was formerly part of the WPRMP, WECPP, WPSSM and WEMAM units.