사용중인 포트의 프로세스 찾기
fuser -n tcp [port]
프로세스 강제 종료
kill -9 [pid]
fuser -n tcp [port]
프로세스 강제 종료
kill -9 [pid]
RedirectView rv = new RedirectView("list.do?param=1"); rv.setExposeModelAttributes(false); return new ModelAndView(rv);
[2011-06-12] 추가
Redirect 할 경우 Model의 값들이 URL에 Parameter값이 붙을경우 위와 같이 하면 Parameter 을 없앨수 있다.
int myNumber = 1234567; // 화폐단위로 변환 String s = String.format("%,d원", myNumber); System.out.println("s: " + s); // 자리수 마추기 s = String.format("%010d", 1234567); System.out.println("s: " + s);
import java.lang.reflect.Field; import java.lang.reflect.Method; public class ClassInfo { public static void main(String[] args) { try { Class c = Class.forName("domain.VoClass"); Method m [] = c.getDeclaredMethods(); Field f [] = c.getDeclaredFields(); System.out.println(f.length); for (int i = 0; i < f.length; i++) System.out.println(f[i].toString()); System.out.println(m.length); for (int i = 0; i < m.length; i++) System.out.println(m[i].toString()); } catch (Throwable e) { System.err.println(e); } } }
import java.util.HashMap; import java.util.Map; public class HelloWorld { public HelloWorld() { } public String getHelloWorld(String name, int value) { return "Hello World to " + name + "(" + value + ")"; } public Map getHashMap(String name, String value) { Map map = new HashMap(); map.put("string", name); map.put("int", value); return map; } }
import java.net.MalformedURLException; import java.net.URL; import java.rmi.RemoteException; import java.util.Map; import javax.xml.namespace.QName; import javax.xml.rpc.ServiceException; import org.apache.axis.client.Call; import org.apache.axis.client.Service; public class ClientTest { public static void main(String[] args) throws ServiceException, MalformedURLException, RemoteException { Service service = new Service(); Call call = (Call)service.createCall(); call.setTargetEndpointAddress(new URL("http://localhost:8081/TEST_AXIS/HelloWorld.jws")); call.setOperationName(new QName("http://soapinterop.org/", "getHelloWorld")); String returnValue = (String)call.invoke(new Object[]{"String Test", 1}); System.out.println(returnValue); call.setOperationName(new QName("http://soapinterop.org/", "getHashMap")); Map returnMap = (Map)call.invoke(new Object[]{"test1", "test1"}); System.out.println(returnMap); } }
public class AuthTest { public String getString(String value){ return "auth test: " + value; } }
import java.net.MalformedURLException; import java.net.URL; import java.rmi.RemoteException; import javax.xml.namespace.QName; import javax.xml.rpc.ServiceException; import org.apache.axis.client.Call; import org.apache.axis.client.Service; public class ClientAuthTest { public static void main(String[] args) throws ServiceException, MalformedURLException, RemoteException { Service service = new Service(); Call call = (Call)service.createCall(); call.setTargetEndpointAddress(new URL("http://localhost:8081/TEST_AXIS/auth/AuthTest.jws")); call.setUsername("wsuser"); call.setPassword("wspwd"); call.setOperationName(new QName("http://soapinterop.org/", "getString")); String returnValue = (String)call.invoke(new Object[]{"String Test"}); System.out.println(returnValue); } }
// $TOMCAT_HOME/cont/tomcat-users.xml 추가
// 해당 Context/web.xml 에 추가Protected /auth/* wsuser BASIC Protected Web Services
String jdbcDriver = "cubrid.jdbc.driver.CUBRIDDriver"; String jdbcURL = "jdbc:cubrid:localhost:30000:testdb:dba::"; String jdbcID = "dba"; String jdbcPWD = "pwd"; Class.forName(jdbcDriver); Connection c = DriverManager.getConnection(jdbcURL, jdbcID, jdbcPWD);