Wednesday, July 3, 2013

request.getParameter() vs request.getAttribute()


from javaranch


A "parameter" is a name/value pair sent from the client to the server - typically, from an HTML form. Parameters can only have String values. Sometimes (e.g. using a GET request) you will see these encoded directly into the URL (after the ?, each in the form name=value, and each pair separated by an &). Other times, they are included in the body of the request, when using methods such as POST.

An "attribute" is a server-local storage mechanism - nothing stored in scoped attribues is ever transmitted outside the server unless you explicitly make that happen. Attributes have String names, but store Object values. Note that attributes are specific to Java (they store Java Objects), while parameters are platform-independent (they are only formatted strings composed of generic bytes).

There are four scopes of attributes in total: "page" (for JSPs and tag files only), "request" (limited to the current client's request, destroyed after request is completed), "session" (stored in the client's session, invalidated after the session is terminated), "application" (exist for all components to access during the entire deployed lifetime of your application).

The bottom line is: use parameters when obtaining data from the client, use scoped attributes when storing objects on the server for use internally by your application only.
 link 

This distinction between getParameter() and getAttribute() become obvious when I tried to articulate variable which was sent in the link tag.

Tuesday, June 18, 2013

Explorer 10 
Password input size is different from its other text box size

how to fix this problem 

Change its font-family

<style type="text/css">
  input {
      font-family: sans-serif;                
  }
</style>

It will fix the problem. 

Difference between out.write() and out.print() in JSP

The major difference between two methods lie on the capability to deal with primitive types other than char[] or String.
out.write() can't but out.print() does.

Sunday, June 16, 2013

Eclipse Tomcat tip

When any revised html or jsp does not reflect on tomcat servlet, 


Chose mini windows below the source section

1. click right click on one of web dynamic folder , 
2. from menu, you may find "clean module directory"
3. which will cleanup your work directory 
4. it will start the new files. 



Friday, May 24, 2013

Oracle tips

how to grant all privileges to user

" grant resource to $user_name"

Monday, May 20, 2013

How to uninstall all your oracle from Windows 7 system.

How to uninstall all your oracle from Windows 7 system.


So its at this point that I decided to go the ‘hard way’ [manual un-installation]
Steps:
Phase 1Stop all Oracle services first.
1) START -> RUN -> Services.msc
2) Locate all Ora* services & click on STOP
Phase 21) Start -> RUN -> Regedit
2) Locate HKEY_LOCAL_MACHINE folder in the registry
3) Open Software folder
4) Delete the Oracle folder under Software5) Open System folder in HKEY_LOCAL_MACHINE6) Open CurrentControlSet folder within the System folder
7) Open Services8 ) Delete all keys related to Oracle. Every key starts with “ORA..”
9) Close the regedit
10) Delete ORACLE_HOME folder
11) Delete the Oracle folder in Program Files
12) Reboot