i'm new to struts... I have a struts form. i need to analyze the data posted to an action class. i just want to output the data to a page and stop further execution so as to test of it is working correctly... how is it done..?
There are many ways to debug a struts application:
Configuration Plugin: You can use configuration plugin provided by struts. To use this plugin include struts2-config-browser-plugin-x.x.x.x.jar jar in your classpath and then you can use
">Launch the configuration browser
anywhere in your application to view a lot of detail about the action class.
The second way is to use Debugging Interceptor by using property debug=true in struts.xml.
See the below link for more details:
http://struts.apache.org/release/2.2.x/docs/debugging-struts.html
The easiest way to quickly and thoroughly inspect http requests and responses and post data is to use either:
http-fox with firefox (download)
chromes' network inspector (pre-installed with chrome - ctrl-shift-i - Network - Click on the appropriate post request and the body of the post will be displayed)
If neither of these very easy tools appeal, you'll have to find the appropriate hook to attach your debugger. I've not used struts since 2002 so cann't advise.
The best method is to use System.out.print and get the result in the tomcat console... i had said i need on server side not client side.
Related
When I try to display REST tools from the main page
It ends up with error
Can't read from server. It may not have the appropriate access-control-origin settings
The page looks like below
Why does this appear instead of swagger docs? Is there any misconfiguration or maybe some privileges not set?
It looks like that exception comes from Swagger side. Have you check If you have provided
'apiBasepath' at '/modules/rest-tools/config/apiBasepath'
Default value for preconfigured Magnolia bundles should be 'http://localhost:8080/magnoliaAuthor/.rest' but you should adjust it to your configuration.
Cheers,
İlgün
I have a custom workflow for which the first step is default AEM "LockProcess". But somehow the asset/page not getting locked.
I have initiated the workflow as an admin and I'm using AEM 6.2
27.07.2017 13:16:09.994 *INFO* [JobHandler:
/etc/workflow/instances/server0/2017-07-25/workflow_name:/content/project/en-
us/test-general] com.day.cq.workflow.impl.process.LockProcess Locking is not
currently enabled. This is a No-Op
The same happens for "UnlockProcess".
Am I missing something here?
Thanks!!
You can enable locking of the payload in the "Day CQ Workflow Service" configuration.
Based on comments from Adobe Forum, I found there is a property
cq.workflow.service.allow.locking that should be enabled in CQWorkflowService.
Unfortunately, I could not find CQWorkflowService in http://localhost:4502/system/console/configMgr.
Digging further I found this website Missing Service that list all missing the hyperlinks for factory service and components of AEM 6.2.
Finally, I was able to initiate the default Lockprocess.
I just read the gwt-log Getting Started guide and found it very helpful, however I have a few questions surrounding the Loggers:
The SystemLogger sends output to System.err and System.out - in the context of a client-side web app running inside a browser, where will this output eventually go? Browser logs?
Does RemoteLogger depend on JUL or log4j? I have a homegrown slf4j binding that I like to use for all my Java backends, and would like to use it, but not sure if RemoteLogger will be incompatible with it?
Is it possible to have RemoteLogger hit my own LoggingServiceServlet, which could then translate the log messages coming in on the HttpServletRequest into logging statements that are compatible with my custom slf4j binding? If so, what might this config look like?
Thanks in advance!
In this link, you have a most updated documentation about the GWT logging framework
Answers to your questions:
#1 Yes it works in client side, but only when running the app in DevMode (not in production nor superdev mode). Look for the log lines in the DevMode window, or in your terminal output if you run dev-mode from the command-line.
#2 It depends on java.util.logging, you can change it though (see #3)
#3 Yes you can change the logging framework extending the RemoteLoggingServiceImpl and overriding the logOnServer(LogRecord lr) method.
I try to enable NCSA request logging in pax-web 1.1.4. The recommended way to do it doesn't work. The file was created but it stays empty. Looking in source code I found that pax web implementation of Jetty server passes requests to JettyServerHandlerCollection which assumes that every handler should correspond a context. So it looks impossible for me just to use org.ops4j.pax.web.log.ncsa.* options.
Am I missing something or this functionality doesn't work in pax web? Are there any workarounds?
Yep, it's a bug in Pax-Web and has been filed on PAXWEB-416
I have my app engine project myproject.appspot.com hosted at myprojectsdomain.com. I want to permanently redirect all links at myprojectsdomain.com to brandNewDomain.com. I found the Java URL Rewrite filter at http://code.google.com/p/urlrewritefilter/ , but I'm not seeing the documentation on how to use this for a 301 redirect for changing the domain. All the examples seem to be for rewriting the url within the same domain, which doesn't do me much good in my current situation. Am I looking in the wrong places or is there a better way for me to permenantly redirect my Google App Engine Java project? Thanks!
Yes, you are looking at the wrong module. urlrewritefilter just changes the URL before your servlet gets to see it (but it still goes to that servlet). It does not do redirects.
You can implement this yourself, by mapping all URL to a single servlet, which just returns the redirect response (response.sendRedirect).
I would use OCPsoft Rewrite for this:
With Rewrite:
Here is how to do this using Rewrite, which is very configurable.
ConfigurationBuilder.begin()
.defineRule()
.when(Domain.matches("myprojectsdomain.com").and(Path.matches("/{1}")
.where("1").matches(".*")))
.perform(Redirect.permanent("http://brandNewDomain.com/{1}"));
I hope this helps, or at least gives ideas on how to do it with any Rewrite tool.
~Lincoln