我的编译器无法找到HttpServletRequest getServletContext()方法.
我没有做太复杂的事情:
public static void setMySortedSet(HttpServletRequest request, SortedSet<String> set)
{
setMySortedSet(request.getServletContext(), set);
}
Run Code Online (Sandbox Code Playgroud)
我尝试了一些故障排除:
当我使用Eclipse时,找到了该方法,但是当我尝试构建类时,我看到了这个:
compile:
[javac] Compiling 1 source files to C:\...\workspace\proj\build\WEB-INF\classes
[javac] C:\...\workspace\proj\src\main\Helper.java:26: cannot find symbol
[javac] symbol : method getServletContext()
[javac] location: interface javax.servlet.http.HttpServletRequest
[javac] return getURISet(request.getServletContext());
[javac] ^
[javac] Note: C:\...\workspace\proj\src\main\Helper.java uses unchecked or unsafe operations.
[javac] Note: Recompile with -Xlint:unchecked for details.
[javac] 1 error
Run Code Online (Sandbox Code Playgroud)
我可能缺少什么想法?我感谢任何回应.
这是我的第一次发布-我发现了类似的问题,但没有直接与此问题相关的任何内容。这听起来很简单,但我不确定为什么会这样。我的程序可以在Eclipse中很好地运行,但不能从命令行运行。我在simpletree包中有几个类。
这是BinaryTree.java:
package simpletree;
import java.io.*;
public class BinaryTree implements Serializable {
// Automatically generated UID
private static final long serialVersionUID = -3124224583476129954L;
BinaryTree leftNode; // left node
BinaryTree rightNode; // right node
// some code
}
class Tree implements Serializable {
private static final long serialVersionUID = 6591795896216994405L;
private BinaryTree root;
// some code
}Run Code Online (Sandbox Code Playgroud)
和Program1Test.java:
package simpletree;
public class Program1Test {
public static void main(String[] args) {
Tree tree = new Tree(); …Run Code Online (Sandbox Code Playgroud) 我需要将数据库导出为 ASCII 格式的制表符分隔文件。我正在使用派生列将任何 Unicode 字符串转换为非 Unicode 字符串。例如,以前的 Unicode 文本流现在转换为:
(DT_TEXT,20127)incomingMessage
Run Code Online (Sandbox Code Playgroud)
但SSIS仍在寻找ANSI。我仍然在平面文件目标处看到错误:
The code page on input column <column_name> is 1252 and is required to be 20127.
Run Code Online (Sandbox Code Playgroud)
表中的任何列都会发生这种情况,而不仅仅是 Unicode 列。
这就是我一直在做的确保使用 ASCII 的方法:
有什么想法吗?