Question List

1) How to start jetty in Maven?

http://docs.codehaus.org/display/JETTY/Maven+Jetty+Plugin#

http://www.eclipse.org/jetty/documentation/current/jetty-maven-plugin.html#maven-http-connector

<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
	xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
	<modelVersion>4.0.0</modelVersion>
	<groupId>edu.xmu.jetty</groupId>
	<artifactId>jetty-core</artifactId>
	<packaging>war</packaging>
	<version>0.0.1-SNAPSHOT</version>
	<name>jetty-core Maven Webapp</name>
	<url>http://maven.apache.org</url>

	<properties>
		<jetty.version>9.2.0.v20140526</jetty.version>
	</properties>

	<dependencies>
		<dependency>
			<groupId>junit</groupId>
			<artifactId>junit</artifactId>
			<version>3.8.1</version>
			<scope>test</scope>
		</dependency>
	</dependencies>
	<build>
		<finalName>jetty-core</finalName>
		<plugins>
			<plugin>
				<groupId>org.eclipse.jetty</groupId>
				<artifactId>jetty-maven-plugin</artifactId>
				<version>${jetty.version}</version>
				<configuration>
					<webApp>
						<contextPath>/jetty</contextPath>
					</webApp>
				</configuration>
			</plugin>
		</plugins>
	</build>
</project>

 

2) How to transfer File using SFTP?

 

3) How to config tomcat as static file server?

    1> http://stackoverflow.com/questions/7068046/how-can-i-list-all-the-files-in-folder-on-tomcat

    2> http://stackoverflow.com/questions/5191735/is-it-possible-to-use-apache-tomcat-server-as-a-http-file-server 

    Change web.xml:

<init-param>
    <param-name>listings</param-name>
    <param-value>false</param-value>
</init-param>

    To:

<init-param>
    <param-name>listings</param-name>
    <param-value>true</param-value>
</init-param>

 

 

4) How to use AOP for easy logging?

 

5) How to config embeded jetty for built-in server test?

package edu.xmu.jetty;

import org.eclipse.jetty.server.Connector;
import org.eclipse.jetty.server.Server;
import org.eclipse.jetty.server.ServerConnector;
import org.eclipse.jetty.server.handler.HandlerCollection;
import org.eclipse.jetty.servlet.ServletContextHandler;

public class XMUJettyServer {
    public static void main(String[] args) throws Exception {
	Server server = new Server();
	ServerConnector connector = new ServerConnector(server);
	connector.setPort(8080);
	server.setConnectors(new Connector[] { connector });
	connector = new ServerConnector(server);
	connector.setPort(8888);
	server.addConnector(connector);
	connector = new ServerConnector(server);
	connector.setPort(9999);
	server.addConnector(connector);

	HandlerCollection handlerCollection = new HandlerCollection();

	ServletContextHandler contextHandler = new ServletContextHandler();
	contextHandler.setContextPath("/jetty");
	contextHandler.addServlet(HelloServlet.class, "/hello");
	contextHandler.addServlet(WelcomeServlet.class, "/welcome");
	handlerCollection.addHandler(contextHandler);

	ServletContextHandler contextHandler2 = new ServletContextHandler();
	contextHandler2.setContextPath("/jetty2");
	contextHandler2.addServlet(HelloServlet.class, "/hello");
	contextHandler2.addServlet(WelcomeServlet.class, "/welcome");
	handlerCollection.addHandler(contextHandler2);

	server.setHandler(handlerCollection);

	server.start();
	server.join();
    }
}

 

package edu.xmu.jetty;

import java.io.IOException;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

public class WelcomeServlet extends HttpServlet {
    private static final long serialVersionUID = -8222528449250075162L;

    @Override
    protected void doGet(HttpServletRequest req, HttpServletResponse resp)
	    throws ServletException, IOException {
	System.out.println("WELCOME");

	super.doGet(req, resp);
    }
}

 

package edu.xmu.jetty;

import java.io.IOException;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

public class HelloServlet extends HttpServlet {
    private static final long serialVersionUID = -8222528449250075162L;

    @Override
    protected void doGet(HttpServletRequest req, HttpServletResponse resp)
	    throws ServletException, IOException {
	System.out.println("HELLO");

	super.doGet(req, resp);
    }
}

 

<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
	xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
	<modelVersion>4.0.0</modelVersion>
	<groupId>edu.xmu.jetty</groupId>
	<artifactId>jetty-core</artifactId>
	<packaging>war</packaging>
	<version>0.0.1-SNAPSHOT</version>
	<name>jetty-core Maven Webapp</name>
	<url>http://maven.apache.org</url>

	<properties>
		<jetty.version>9.2.0.v20140526</jetty.version>
	</properties>

	<dependencies>
		<dependency>
			<groupId>junit</groupId>
			<artifactId>junit</artifactId>
			<version>3.8.1</version>
			<scope>test</scope>
		</dependency>
		<dependency>
			<groupId>org.eclipse.jetty</groupId>
			<artifactId>jetty-server</artifactId>
			<version>${jetty.version}</version>
		</dependency>
		<dependency>
			<groupId>org.eclipse.jetty</groupId>
			<artifactId>jetty-servlet</artifactId>
			<version>${jetty.version}</version>
		</dependency>
	</dependencies>
</project>

 

 

6) How HashMap works in Java? Why iteration keyset less effecient?

    How TreeMap & TreeSet works in JDK?

http://cl315917525.iteye.com/blog/835107

 

7) WebService? WSDL? SOAP?

http://www.w3schools.com/Webservices/ws_wsdl_ports.asp

 

8) Hibernate In Depth

 

9) Spring AOP In Depth

 

10) Java FileWatcher?

 

11) Java Scheduler??

 

12) Install Eclipse Plugin offline?

        1) http://stackoverflow.com/questions/5482554/how-to-install-plugin-for-eclipse-from-zip

        2) http://www.crifan.com/install_eclipse_plugin_from_compressed_package_zip_file/

13) Spring Batch/Integration???

 

14) How to start a process in java??

        1) http://stackoverflow.com/questions/3643939/java-process-with-input-output-stream

        2) http://stackoverflow.com/questions/9869101/reading-inputstream-from-java-process

 

15) JVM Stack & Heap Memory Model?

        1) http://javarevisited.blogspot.com/2013/01/difference-between-stack-and-heap-java.html

        2) http://programmers.stackexchange.com/questions/65281/stack-and-heap-memory-in-java

        3) http://android.blog.51cto.com/268543/50100

 

 

16) Chain of Responsibility Pattern?

 

17) Spring IoC bean's scopes?

 

18) B-Tree, B+ Tree, Black-Red-Tree?

     B-Tree means balanced tree.

     B+tree are enhanced version of B-tree for file/db index. All nond stores in leaf.

      BR Tree is a self balanced binary tree which works exactly like B+Tree whose "jie" is 3. But BR Tree is easier to impl than B+Tree.

 

19) Java Memory Model?

      http://www.cs.umd.edu/~pugh/java/memoryModel/

 

 20) How to use "Timer" and "ScheduledThreadPoolExecutor"?

 

 21) How to create transaction in spring? The propagate of transaction?

 

22) How to optimize SQL?

 

23) What's memcached?

 

24) How to create auto increment primary key in Oracle?

http://stackoverflow.com/questions/11296361/how-to-create-id-with-auto-increment-on-oracle

 

25) IO Performance tuning:

http://www.oracle.com/technetwork/articles/javase/perftuning-137844.html

http://zheng12tian.iteye.com/blog/1100721

 

26) How to bypass E-Git SSL Error?

http://gitblit.com/faq.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值