0
  1. Want to generate page events(pageload()) in is that possible?

  2. How to check weather a page is reloaded? In there is method name isPostBack() to check weather the page is request or reload is there anything in ?

  3. How to get start with struts and hibernate?

Nico Haase
  • 11,420
  • 35
  • 43
  • 69
Loga
  • 658
  • 1
  • 7
  • 17

2 Answers2

2

You need to realize that JSP is just a view technology like as Classic ASP. JSP and Classic ASP are not a MVC framework like ASP.NET-MVC which offers the Page#IsPostback() method. The real Java counterpart of ASP.NET-MVC is JSF which offers the FacesContext#isPostback() method.

In plain vanilla JSP it's just as simple as implementing the method yourself:

public static boolean isPostback(HttpServletRequest request) {
    return request.getMethod().equals("POST");
}

The point of a MVC framework is that it saves you from all the boilerplate code like that. If you want a Java counterpart of ASP.NET-MVC, then have a look at JSF (component based) or Spring MVC (request based). Struts and Hibernate are aged. Instead of Hibernate, have a look at JPA. Infact, have a look at the entire Java EE 6 API.

See also:

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

To check for a page reload you could use 'onBodyload' and 'onBodyUnload' events in body tag of your HTML code.

For struts and hibernate check out onlojne documentation available. Good material to start with.

Incredible
  • 3,495
  • 8
  • 49
  • 77
Maruti
  • 61
  • 1
  • 3