Wednesday, March 14, 2012

How to give command line arguments in eclipse

9:25 AM 0
How to give command line arguments in eclipse
It's simple,
Create a test programe on eclipse IDE.

public class NameArguments {
public static void main(String[] args) {
System.out.println("First Name " + args[0]);
System.out.println("Last Name " + args[1]);

Goto: Run->Run Configurations

in that window select Arguments tab and give the arguments(only the arguments)
Notice that there is at least one space between every two arguments.
Then just click Apply

execute the code.
output would be

First Name Pradeep
Last Name Rathnayaka

Wednesday, January 4, 2012

JSP URL Mapping

11:27 PM 0
JSP URL Mapping
Given in the figure below JSP resources reside under subdirectories or directly there in the document root that are accessible directly to users via URL. In order to protect the web resources, behind WEB-INF directory hide the JSP files that provide protection to JSP files, Java Script files, image files, css files (cascading style sheets), pdf files, html files etc, from the direct access. To servlet, a request shall be made as it is responsible for the authorization as well as authentication of use before JSP pages/resources are returned.