[58 Argo] Run argo

Source: Internet
Author: User

Next, run the mvn jetty: run Command to start Argo to the localhost page:

58. Several common access and value passing methods are provided here. When you click the third article "differentiate queryString and form Parameters,

The Post submission page is displayed. Enter name and phone and submit the page.

The following error occurs:

com.bj58.argo.ArgoException: invoke exception.at com.bj58.argo.ArgoException$ArgoExceptionBuilder.build(ArgoException.java:98)at com.bj58.argo.internal.ActionInfo.invoke(ActionInfo.java:222)at com.bj58.argo.internal.MethodAction.matchAndInvoke(MethodAction.java:61)at com.bj58.argo.internal.DefaultRouter.route(DefaultRouter.java:45)at com.bj58.argo.internal.DefaultArgoDispatcher.route(DefaultArgoDispatcher.java:89)at com.bj58.argo.internal.DefaultArgoDispatcher.service(DefaultArgoDispatcher.java:70)at com.bj58.argo.servlet.ArgoFilter.doFilter(ArgoFilter.java:45)at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:220)at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:122)at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:501)at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:170)at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:98)at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:950)at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:116)at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:408)at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1040)at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:607)at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:315)at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source)at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)at java.lang.Thread.run(Unknown Source)Caused by: java.lang.reflect.InvocationTargetExceptionat sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)at java.lang.reflect.Method.invoke(Unknown Source)at com.bj58.argo.internal.ActionInfo.invoke(ActionInfo.java:217)... 21 moreCaused by: java.lang.NullPointerExceptionat com.bj58.argo.servlet.ArgoRequest.getParamsString(ArgoRequest.java:213)at com.bj58.argo.servlet.ArgoRequest.queryString(ArgoRequest.java:178)at com.bj58.argo.client.ClientContext$DefaultClientContext.queryString(ClientContext.java:187)at com.bj58.argo.controllers.HomeController.postForm(HomeController.java:34)... 26 more

View the source code snippet that reports an exception:

     Map<String, Collection<String>> (queryStrings != <String> params =  MultiMap<String>= (queryStrings != "UTF-8"=

It is found that this code is logically problematic:

If (queryStrings! = Null) return ..
Then there is another
If (queryStrings! = Null)

If queryStrings is not assigned a value in the middle, the logic below is meaningless, whether it is a null value or not.
Apparently, the following logic is incorrect.
Change the following condition to queryStrings = null. The submission is successful.

But is that all done? No
Let's take a look at the modification record of ArgoRequest and find that the final change was due to a BUG reported by hzieept:
When a post request is submitted, a url such as http: // ip/a/B/, no? And parameter information. When super. getQueryString () is called in ArgoRequest. queryStrings (), null is returned. Therefore, add a Wei statement in UrlEncoded.

58code does not think that you should directly modify the urlEncode for the following reasons:

We will make this judgment in advance to ArgoRequest. In principle, we will not modify the source in thirdparty, which is not conducive to future troubleshooting.

Then we changed the null value and put it in ArgoRequest. But it is clear that the null value was wrong and has not been tested. The correct modification should be like this:

(originQueryString != )

Instead

(queryStrings != )

At the same time, we can see that 58code open source is no longer maintained by personnel, and the previous changes are also rough. However, a large number of annotations in the Argo project are clearly and concisely written.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.