0

I am trying to work out how to access content on this site: https://handbook.unimelb.edu.au/

I can manually conduct a search via the browser, and I am tracking the raw http request via HTTP live Headers, but having endless problems working out how the system is actually conducting search.

In particular, using the advanced search via: https://handbook.unimelb.edu.au/faces/htdocs/user/search/AdvancedSearch.jsp

Results in data similar to the following being sent: POST /faces/htdocs/user/search/AdvancedSearch.jsp HTTP/1.1 AdvancedSearchForm%3Akeywords=&AdvancedSearchForm%3ACourseOrSubjectSelection=SUBJECT_ALL&AdvancedSearchForm%3AGraduateLevelSelection=POSTGRADUATE_ALL&AdvancedSearchForm%3AfacultyList=&AdvancedSearchForm%3AdepartmentList=&AdvancedSearchForm%3Alevel=ALL&AdvancedSearchForm%3Asemester=ALL&AdvancedSearchForm%3AallStudyAreas=t&oracle.adf.faces.FORM=AdvancedSearchForm&oracle.adf.faces.STATE_TOKEN=_id51018%3A_id51019&source=AdvancedSearchForm%3AsearchButton

The server immediately responds with "HTTP/1.1 302 Moved Temporarily" and redirects me to "Location: https://handbook.unimelb.edu.au/faces/htdocs/user/search/SearchResults.jsp"

Which actually displays the search results.

As far as I can tell, the search itself must be using a session to store the searched-for terms between the post and the subsequent get.

Is this normal JSF behaviour? Is there a trick to accessing such a system?

Toby Hede
  • 36,755
  • 28
  • 133
  • 162
  • 2
    Your analysis looks correct; JSF's default form components generally rely on POST for data submission but, no, you do not have to implement it this way in JSF. The implementers of the website have not written the application in a way that generates bookmarkable links. – McDowell Dec 27 '12 at 09:57

1 Answers1

1

Is this normal JSF behaviour?

This bahaviour is not "normal". This approach is however explainable for legacy JSF 1.x applications; it's because GET forms weren't natively supported by JSF 1.x. I would however consider this approach rather poor design and have recommended to use <managed-property> to inject GET request parameters. The webapp architect/developer has most likely not really thought it out very well. Note that since JSF 2.0, which is out for little over 3 years already, GET forms using plain HTML <form> are natively supported thanks to the new <f:viewParam> tag.


Is there a trick to accessing such a system?

Tell your HTTP client to maintain the session (read: the cookies) and auto-follow redirects. By default, JSF relies heavily on the session already as it stores the view state in there as well. This is in turn not related to the way how that webapp is designed.

See also:

Community
  • 1
  • 1
BalusC
  • 1,082,665
  • 372
  • 3,610
  • 3,555