小编Kev*_*vin的帖子

Nullpointerexception java

首先,我是一名经验丰富的程序员,但对Java很少熟悉.八年前,我有两年的经验.

我在以下代码中遇到NullPointerException:

public static void handle(HttpServletRequest request,HttpServletResponse response)throws IOException,ServletException {

    Response gfexResponse = null;

    try {

        ActionFactory actionFactory = ActionFactory.getInstance();
        String requestURL = request.getRequestURI();
        String actionId = actionFactory.getActionId(requestURL);

        IAction action = actionFactory.createAction(actionId);

        ActionEvent event = new ActionEvent(request, 0, actionId);
        gfexResponse = action.execute(event);

    } catch (Exception ex) {        
        gfexResponse = new Response();
        gfexResponse.setError(ex.getMessage());
        gfexResponse.setOutcome(IViewConstants.ERROR);

    } finally {

        if(request.getParameter("loginId") != null){
            request.setAttribute("loginId", request.getParameter("loginId"));
        }

        if(gfexResponse.getMessage()!= null){
            request.setAttribute("message", gfexResponse.getMessage());
        }

        if(gfexResponse.getError()!= null){
            request.setAttribute("error", gfexResponse.getError());
        }

        if (gfexResponse.getContentType() != null) {
            response.setContentType(gfexResponse.getContentType());
            OutputStream outputStream …
Run Code Online (Sandbox Code Playgroud)

java nullpointerexception

7
推荐指数
1
解决办法
6255
查看次数

如何使用TSL加密强制VB6进行POST?

我工作的公司有一个旧的VB6应用程序,他们想强制使用TSL而不是SSL.我查看了代码,告诉他们应该没问题.该代码使用HTTPS向客户端网站发布帖子.它没有指定要使用的加密.

这是相关代码:

Sub PostXML()

Dim XMLHttpRequest  As MSXML2.XMLHTTP
Dim TempString      As String
Dim strURL          As String
Dim strArgs         As String


strURL = gPostWebServer & "/" & gPostFile

'ARB 1/8/2004 This is to trap if send fails and allow it to continue.
On Error GoTo errorHandler:

If Not XMLHttpRequest Is Nothing Then Set XMLHttpRequest = Nothing

Set XMLHttpRequest = New MSXML2.XMLHTTP

strArgs = "?Username=" & gPostUserName & "&Password=" & gPostPassword

XMLHttpRequest.Open "POST", strURL & strArgs, False

XMLHttpRequest.send dom_GlobalXMLObject

If XMLHttpRequest.Status >= …
Run Code Online (Sandbox Code Playgroud)

vb6 http-post

3
推荐指数
1
解决办法
2545
查看次数

标签 统计

http-post ×1

java ×1

nullpointerexception ×1

vb6 ×1