[ Return to Home Help documentation ]
In some cases, we need to direct the development of some simple HTTP interface Tomcat runtime environment, and write simple Java code to handle the business logic processing interface. Next, I will explain to you, if the development in Tomcat HTTP interface to run in the Z platform. And write processing code.
The first, in the Z platform to log on as administrator, and open the "HTTP Interface" feature.
Second, a new interface, for relevant information and save
Interface identifier: TTT Interface Name: Test TTT belongs items: test items is enabled: is Interface Type: Custom Programming Interface
Interface code:
Result result = new Result();
System.out.println("tttttttttttttttttttt");
Result authority = z.isServiceAuthority(bean,request);
if(Code.SUCCESS.equals(authority.getCode())){
}else {
result = authority;
}
return result;
Third, restart the Tomcat service
After completion of interface information saved is automatically created in the Tomcat and build your class interface processing, it is recommended to check whether the interface directory compiled successfully.
Interface handler class storage path: Tomcat webapps directory \ project name \ WEB-INF \ classes \ com \ futvan \ z \ httpservices \ sc
I can see in the catalog, it has successfully generated tttHttpService.java and compile tttHttpService.class documents proving compilation is successful.
Restart Tomcat Service
Fourth, the test interface
Ttt call the interface in the browser | HTTP: // server address / ttt has proven interface calls successful return information
Above is the whole process of developing a custom interface in a Tomcat environment, if any questions or suggestions in the development process can be a message to the AC group