Struts 2 Passing Parameter with dot in Google App Engine - google-app-engine

I can pass parameter in Struts 2 (GAE app) Url something like below:
http://localhost:8888/user/jr
http://localhost:8888/user/jr#jrgalia
But i got an error for
http://localhost:8888/user/jr#jrgalia.com
How to allow to pass parameter with dot character?
Below is in struts.xml
....
<constant name="struts.enable.SlashesInActionNames" value="true"/>
<constant name="struts.mapper.alwaysSelectFullNamespace" value="false"/>
...
<action name="/user/*" class="LinkAction" method="usersLink">
<param name="userName">{1}</param>
<result>
<param name="location">/index.jsp</param>
<param name="parse">false</param>
<param name="encode">false</param>
</result>
</action>
Below is the error:
HTTP ERROR 404
Problem accessing /user/jr#jrgalia.com. Reason:
NOT_FOUND
Powered by Jetty://

Related

Camel REST to Controlbus

I am exposing a REST endpoint to control Camel Routes:
<get uri="/camel/route/{id}" produces="text/plain">
<description>stop a camel route by its ID</description>
<param name="id" type="path" description="Route ID" dataType="string"/>
<param name="action" type="query" description="Action to take" dataType="string"/>
<responseMessage message="OK" code="200" />
<to uri="controlbus:route?routeId=${header.id}&action=${header.action}"/>
</get>
But the control bus seems fail to resolve ID and Action as it log as:
ControlBusProducer - ControlBus task done [${header.action} route ${header.id}] with result -> void
How do I resolve REST path and query parameters in the route?
Expressions such as ${header.action} are not evaluated in <to> processors. If you are using a recent version of Camel use <toD> instead. If that's not available in your version, <recipientList> can do the job.
http://camel.apache.org/how-to-use-a-dynamic-uri-in-to.html

Problems retrieving octet-stream in AngularJS application using Internet Explorer

In an angularjs application I am making a call to a REST service that returns an octet-stream. The content of the stream is a xml file, that I want to get the content of and then pass onto another control. This works fine in Chrome and Firefox but in IE (I have 11, but also saw this in Edge) the content returned looks like garbage (actually a bunch of chinese characters) when I debug through IE Developer tools, and the subsequent control fails because it is expecting xml.
<resource path="/{type}/{modelName}">
<param name="type" style="template" type="xs:string"/>
<param name="modelName" style="template" type="xs:string"/>
<method name="POST">
<request>
<representation mediaType="text/plain">
<param name="request" style="plain" type="xs:string"/>
</representation>
</request>
<response>
<representation mediaType="application/octet-stream"/>
</response>
</method>
</resource>
And the call looks like:
Restangular.one('streams/graphML/' + model.name + '?maxNodes=1000').withHttpConfig(config).get().then(function (response) {
callback({error: false, data: response});
},
function (response) {
spectrumSdkLog.error(response.data);
callback({error: true, message: response.data});
});
Any help with why this is would be greatly appreciated. I have been looking for an answer but have yet to find one.
Thanks

Getting org.apache.jackrabbit.core.state.ItemStateException while working with jackrabbit repository

class="org.apache.jackrabbit.core.persistence.bundle.PostgreSQLPersistenceManager">
<param name="driver" value="org.postgresql.Driver" />
<param name="url" value="jdbc:postgresql://192.168.1.200:5433/NEWDMS" />
<param name="user" value="postgres" />
<param name="password" value="eminence" />
<param name="schema" value="postgresql" />
<param name="schemaObjectPrefix" value="${wsp.name}_" />
<param name="externalBLOBs" value="false" />
</PersistenceManager>
I have created a transient Repository and done changes in repository.xml file
while accessing jackrabbit repository i am getting following exception : org.apache.jackrabbit.core.state.ItemStateException: failed to read bundle: deadbeef-face-babe-cafe-babecafebabe
java.lang.IllegalArgumentException: Invalid namespace index: 3158064
The "failed to read bundle: deadbeef-face-babe..." message is a symptom of a repository inconsistency. Start with these knowledge base articles: Fix the "jcr:system" node, Consistency Check, and Tar Data File Rotation. The third link highlights this configuration parameter of the persistence manager that might be of interest (although I see that you are not using the default TPM persistence manager, so it might not be relevant):
<param name="maxFileSize" value="512" />

How do I prevent SimpleSecurityManager being used in JackRabbit?

How I stop Jackrabbit using SimpleSecurityManager?
I'm trying to call session.getUserManager() but I get a repository exception as SimpleSecurityManager.getUserManager() explicity throws it.
<Security appName="Jackrabbit">
<SecurityManager class="org.apache.jackrabbit.core.DefaultSecurityManager" workspaceName="security">
</SecurityManager>
<AccessManager class="org.apache.jackrabbit.core.security.simple.SimpleAccessManager">
<!-- <param name="config" value="${rep.home}/access.xml"/> -->
</AccessManager>
<LoginModule class="org.apache.jackrabbit.core.security.authentication.DefaultLoginModule">
<param name="anonymousId" value="anonymous"/>
<param name="adminId" value="admin"/>
</LoginModule>
</Security>
Rest of code for those that will ask...
Repository repository = new TransientRepository();
Session jackrabbitSession = repository.login(credentials);
UserManager userManager = session.getUserManager();
The user manager is a Jackrabbit extension. It's not a part of the JCR. So, you need to use a JackrabbitSession, not just a Session. Here's a link to the wiki:
http://wiki.apache.org/jackrabbit/UserManagement

Problem with execAndWait interceptor, SESSION lost

I am using execAndWait interceptor and it seems the session is lost after the interceptor..
my code is - struts-lcms.xml
...
<action name="testAction" class="com.lcms.presentation.TestAction">
<interceptor-ref name="execAndWait"></interceptor-ref>
<param name="delay">3000</param>
<param name="delaySleepInterval">50</param>
<result name="wait" type="tiles">tiles.ques</result>
<result name="success" type="tiles">tiles.ques</result>
<result name="diag" type="redirectAction">diagnosticAction</result>
</action>
...
If I remove the interceptor code then it takes me to the question page (tiles.ques) .. However, with the interceptor the session is null..
This code in execute method in the TestAction file
SessionObject sess = (SessionObject)getSession().getAttribute(LcmsConstants.SESSION_OBJECT);
it gives the session correctly if the interceptor is not used.. however, if the interceptor code is used then it throws NULL pointer exception..
Please tell me how to overcome this problem..
implements SessionAware
http://struts.apache.org/2.0.6/struts2-core/apidocs/org/apache/struts2/interceptor/ExecuteAndWaitInterceptor.html
Important: Because the action will be running in a seperate thread, you can't use ActionContext because it is a ThreadLocal. This means if you need to access, for example, session data, you need to implement SessionAware rather than calling ActionContext.getSesion().
mention in struts.xml as
<interceptor-stack name="loadingStack">
<interceptor-ref name="completeStack" />
<interceptor-ref name="execAndWait">
<param name="delay">1000</param>
<param name="delaySleepInterval">500</param>
</interceptor-ref>
</interceptor-stack>
<interceptor-ref name="loadingStack"/>
<result name="wait">ETAX/TDS/wait.jsp</result>
it is working fine on my machine

Resources