小编tps*_*wal的帖子

在Oracle中使用Jetty进行连接池

我想实现的概念ConnectionPoolingOracle使用Jetty的服务器.我在教程中看到了以下内容.如果我使用Tomcat服务器部署它,它Jetty似乎工作,但似乎给了我一个不寻常的error.详情如下 -

我有一个名为TestServlet.java-

import java.io.IOException;
import java.sql.*;
import javax.naming.*;
import javax.servlet.*;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.*;
import javax.sql.DataSource;


@SuppressWarnings("serial")
@WebServlet("/TestServlet")
public class TestServlet extends HttpServlet {
public TestServlet() throws ServletException{
    System.out.println("Constructor");
    init();
}
public DataSource dataSource;
private Connection con;
private Statement statement;

public void init() throws ServletException {
    System.out.println("inside init method");
    try {
        // Get DataSource
        Context initContext  = new InitialContext();
        System.out.println("Before envcontext");
        Context envContext  = (Context)initContext.lookup("java:comp/env"); …
Run Code Online (Sandbox Code Playgroud)

java eclipse oracle connection-pooling jetty

6
推荐指数
1
解决办法
4280
查看次数

Ajax呼叫在谷歌Chrome上运行,但在IE 11上运行

我正在开发一个RESTFul web service项目POJO如下:

@XmlRootElement
public class Input {
    //variable declarations 

   public Input(){
      //default constructor 
   }

   //constructor no 1
   public Input(String LR, double ECH,double CSH,String APP) {
        this.LR = LR;
        this.ECH = ECH;
        this.CSH = CSH;
        this.APP = APP;
    }

    //constructor no 2
    public Input(String LR, double ECH,double CSH,String APP,...) {
        this.LR = LR;
        this.ECH = ECH;
        this.CSH = CSH;
        this.APP = APP;
        //constructor of all other parameters including these
    }

//getters and setters method below.
} …
Run Code Online (Sandbox Code Playgroud)

java ajax rest google-chrome internet-explorer-11

6
推荐指数
1
解决办法
1431
查看次数

如何使用该字段的ID通过Servlet读取JSP表单中输入字段的值?

JSP包含此form标签:

<form action="MyServlet" method="post">
    Fname:<input type="text" id="fname" placeholder="type first name"/>
    <input type="submit" value="ok"/>
</form>
Run Code Online (Sandbox Code Playgroud)

我的servlet是:

import java.io.IOException;
import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import com.cad.database.DatabaseClass;
import com.cad.example.service.InputService;


public class Input extends HttpServlet {

    private static final long serialVersionUID = 1L;
    public Input() {
        super();
        // TODO Auto-generated constructor stub
    }
    protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {

        String fname = request.getParameterById("fname");
        System.out.println("My name "+fname);
    }   
}
Run Code Online (Sandbox Code Playgroud)

java html5 jsp servlets

2
推荐指数
2
解决办法
5万
查看次数