Install Subclipse in Eclipse 3.x install plugins in eclipse

Here you will find a screenshot tour of the Subclipse installation process in Eclipse 3.x. These particular screens were captured in Eclipse 3.0.2 running on Windows XP.

in other verion of eclipse

u will select help->install software  add url and folow

Install Subclipse in Eclipse 3.x

Step 1:

Begin the installation from the Eclipse Help menu item.

Install screen

Step 2:

This screenshot show the screen as it initially comes up. In this case you will need to change the radio button to indicate that this is a new install.

Install screen

Step 3:

This screen will vary depending on the features you have installed already. You want to click on the New Remote Site button. If you are behind a proxy and the Eclipse install mechanism does not work, then you can download a zipped version of the update site and then click the New Local Site button instead.

Install screen

Step 4:

This screen is showing the New Remote Site dialog, filled in with the correct information to install Subclipse

              Name: Subclipse 1.6.x (Eclipse 3.2+)
              URL:  http://subclipse.tigris.org/update_1.6.x

              Name: Subclipse 1.4.x (Eclipse 3.2+)
              URL:  http://subclipse.tigris.org/update_1.4.x

              Name: Subclipse 1.2.x (Eclipse 3.2+)
              URL:  http://subclipse.tigris.org/update_1.2.x

              Name: Subclipse 1.0.x (Eclipse 3.0/3.1)
              URL:  http://subclipse.tigris.org/update_1.0.x

Install screen

Step 5:

When you first come back to this screen, the site you added will NOT be selected. Be sure to select it before clicking Next.

Install screen

Step 6:

This next screen shows all of the features that are available to install.

Install screen

Step 7:

Click the button to accept the license agreement.

Install screen

Step 8:

Confirm the install location

Install screen

Step 9:

There is an Eclipse preference to turn off this next dialog. I have never seen a signed feature. Not even Eclipse.org nor IBM sign their features.

Install screen

Step 10:

Just a screenshot of the in-process installation.

Install screen

Step 11:

Eclipse needs to be restarted after installing Subclipse.

Install screen

Step 12:

Finally, after restarting Eclipse, the first thing you will typically want to do is open the Subclipse Repository perspective where you can define your repositories. Be sure to also check the online help as well as the Subclipse preferences located under Team -> SVN.

Install screen

Updating Subclipse in Eclipse 3.x

Eclipse 3.x has a feature in preference to automatically check for updates. Provided you are not behind a proxy that does not allow this feature, it should work for Subclipse. Otherwise just follow the instructions for installing Subclipse, except take the option to check for updates in Step 2.

If you are behind a proxy that does not work with Eclipse, then to install updates you just always follow the same instructions you used to install a new version. If you always unzip the site to the same local folder, you will not have to define the local site each time.

 

Typical Uses of Cookies in java

– Identifying a user during an e-commerce session tracking of user information.
– Avoiding username and password
– Customizing a siit
– Focusing advertising

Don’t put sensitive info in cookies

Create a Cookie object.                 ==>Cookie c = new Cookie(“userID”, “a1234”);

Set the maximum age.                   ==>c.setMaxAge(60*60*24*7); // One week

Place the Cookie into the HTTP  ==> response  response.addCookie(c);

Reading Cookies from the Client

String cookieName = “userID”;
Cookie[] cookies = request.getCookies();
if (cookies != null) {
for(Cookie cookie: cookies) {
if (cookieName.equals(cookie.getName())) {
doSomethingWith(cookie.getValue());
}
}
}

 



 

Handling Input in Multiple Languages

Use server’s default character set
String firstName =request.getParameter(“firstName”);
Convert  from English (Latin 1) to Japanese

———————————————

String firstNameWrongEncoding =request.getParameter( firstName );
request getParameter(“firstName”);
String firstName =new String(firstNameWrongEncoding.getBytes(),”Shift_JIS”);

———————————————

Accept either English or Japanese
request.setCharacterEncoding( JISAutoDetect );
String firstName =request.getParameter(“firstName”);

Debugging Servlets

• Use print statements; run server on desktop
• Use Apache Log4J
• Integrated debugger in IDE
– Right-click in left margin in source to set breakpoint (Eclipse)
– R-click Tomcat and use “Debug” instead of “Start”
R click
Debug
Start
• Look at the HTML source
• Return error pages to the client
– Plan ahead for missing or malformed data
g
• Use the log file
– log(“message”) or log(“message”, Throwable)
• Separate the request and response data.
p
q
p
– Request: see EchoServer at www.coreservlets.com
– Response: see WebClient at www.coreservlets.com
• Make sure browser is not caching
– Internet Explorer: use Shift-RELOAD
– Firefox: use Control-RELOAD
• Stop and restart the server

servlet life cycle

• init
– Executed once when the servlet is first loaded.
Not called for each request.
• service
– Called in a new thread by server for each request.
Dispatches to doGet, doPost, etc.p
Do not override this method!
• doGet, doPost, doBlah
– H dl GET, POST, etc. requests.
Handles GET POST
– Override these to provide desired behavior.
• destroy
– Called when server deletes servlet instance.
Not called after each request.