Ashu Jain

Ranch Hand
+ Follow
since Feb 24, 2008
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
In last 30 days
0
Forums and Threads

Recent posts by Ashu Jain

Hi, Can anyone suggest me good elaborate link for concurrency features JDK 5 provides.

Please help. I do not have to book for the same.

Thanks
My JSP page used autocompleter that works fine. cities in below code of JSP is a hashmap.
The textbox shows key value of hashmap. What do i need to do in order to show value of the hashmap.
Please help.



Please help.
15 years ago

Hi ,

I wanted to invoke a javascript method when one make an entry to the textbox but seems like onclick is not getting invoked on autocompleter tag.

Both the below generate textboxes with data getting filled automatically. but i am not getting any alert. Nor there is any other error. Please guide.

I am working with Struts 2.1

15 years ago
But it does not seem to be working in 2.0.x

HelloWorld.java

ExampleSupport.java


struts.xml is as follows::



and HelloWorld.jsp



I have json plugin apart from struts core 2.0 in WEB-INF\lib

There is no error but it is still not working. What could be the problem.
15 years ago
Does that mean that i can NOT use autocompleter theme ajax in 2.0.* at all.

I thought people used to implement autocompleter earlier as well. it is just dojo tags moved to another jar ( plugin of dojo tags ).

I want to implement autocompleter theme ajax in 2.0.*. How to do that without dojo??

15 years ago
Hi,

I am able to implement autocompleter ( theme ajax) in struts 2.1 but unable to do so in 2.0.14

It says "struts-dogo-tags" not found. I am refering to http://struts.apache.org/2.0.14/docs/autocompleter.html

but there does not exist any jar for struts-dogo plugin in 2.0.14. Can you please suggest if it will work by including dogo plugin jar of 2.1. I can not change my application to struts 2.0
.

15 years ago
Hi,

My struts.xml is as follows::



HelloWorld.java is as follows::



Login.java is as follows::



My HelloWorld.jsp is as follows::



It is not working for me. Please help
15 years ago
Will this work in same workspace or i should have action/result JSP under namespace that extends "struts-default"

<package name="example" namespace="/example" extends="json-default">
<action name="HelloWorld" class="example.HelloWorld">
<result type="json"><param name="root">testingMap</param></result>
</action>

<action name="HelloWorld" class="example.HelloWorld">
<result>/example/HelloWorld.jsp</result>
</action>


Please help and guide.

15 years ago
Actually, I was using this in my struts xml file

<action name="HelloWorld" class="example.HelloWorld">
<result>/example/HelloWorld.jsp</result>
</action>

Purpose - Result of the action redirected to HelloWorld.jsp.

Now in HelloWorld.jsp, I require a textbox with autocompleter functionality. I believe for that we require json String

I believe this can be done with


<action name="HelloWorld" class="example.HelloWorld">
<result type="json"><param name="root"></param></result>
</action>
But this way i can not specify which the next jsp. How to do that.
15 years ago
Hi,

I am new to struts . Please help me in implementing autocompleter tag in textbox.

My java action is ::

public class HelloWorld extends ExampleSupport {

private Map<String,String> testingMap;
private List<String> testingMapKeys;

public String execute() throws Exception {
testingMap = new HashMap<String,String>();
testingMapKeys= new ArrayList<String>();

testingMap.put("TREE","DEL");
testingMap.put("HELLO","MUM");

testingMapKeys.add("TREDD");
testingMapKeys.add("TREND");

return SUCCESS;
}

public Map<String,String> getTestingMap() {
return testingMap;
}

public List<String> getTestingMapKeys() {

return testingMapKeys;
}


}


My Jsp is ::

...
<%@ taglib prefix="s" uri="/struts-tags" %>
<%@ taglib prefix="sx" uri="/struts-dojo-tags" %>
...
<head>
<title><s:text name="HelloWorld.message"/></title>
<sx:head debug="true"/>
</head>

...
<body>
<s:url id="cityTest" action="HelloWorld" />
<sx:autocompleter name="origin" href="%{cityTest}" showDownArrow="false" autoComplete="false" dataFieldName="testingMap" />
...

My Struts .xml

<package name="example" namespace="/example" extends="json-default">
<action name="HelloWorld" class="example.HelloWorld">
<result type="json">/example/HelloWorld.jsp</result>
</action>
.....
</package>

Please tell me where i am wrong. I am unable to get back values of testingMap in Json format in my Jsp. At first i am unable to get to my Jsp page. Please help me with theme ="ajax"

15 years ago
Hi,

I am new to struts . Please help me in implementing autocompleter tag in textbox.

My java action is ::

public class HelloWorld extends ExampleSupport {

private Map<String,String> testingMap;
private List<String> testingMapKeys;

public String execute() throws Exception {
testingMap = new HashMap<String,String>();
testingMapKeys= new ArrayList<String>();

testingMap.put("TREE","DEL");
testingMap.put("HELLO","MUM");

testingMapKeys.add("TREDD");
testingMapKeys.add("TREND");

return SUCCESS;
}

public Map<String,String> getTestingMap() {
return testingMap;
}

public List<String> getTestingMapKeys() {

return testingMapKeys;
}


}


My Jsp is ::

...
<%@ taglib prefix="s" uri="/struts-tags" %>
<%@ taglib prefix="sx" uri="/struts-dojo-tags" %>
...
<head>
<title><s:text name="HelloWorld.message"/></title>
<sx:head debug="true"/>
</head>

...
<body>
<s:url id="cityTest" action="HelloWorld" />
<sx:autocompleter name="origin" href="%{cityTest}" showDownArrow="false" autoComplete="false" dataFieldName="testingMap" />
...

My Struts .xml

<package name="example" namespace="/example" extends="json-default">
<action name="HelloWorld" class="example.HelloWorld">
<result type="json">/example/HelloWorld.jsp</result>
</action>
.....
</package>

Please tell me where i am wrong. I am unable to get back values of testingMap in Json format in my Jsp. At first i am unable to get to my Jsp page. Please help me with theme ="ajax"
15 years ago
I was going through HFSJ 1st edition Q15.

Q:- Once a session has been invalidated, which HttpSession methods can be called on that session without throwing illegalState Exception?

Options -

A: invalidate
B: getAttribute
C: setAttribute
D: getServletContext
E: getAttributeNames

Answer: - Since the servletContext survives, getServletContext can be called successfully on an invalid session.

I am not so clear why? if an object is invalid now...how and why getServletContext servives. Trying to access this should give null pinter exception or illegalStateException.

Please clarufy this doubt


It is also important to note that the varReader scoped variable has nested visibility; it can only be accessed within the body content of <c:import>.


Not so clear of varReader. IS it same as var attribute. To my understanding var attribute is created at page scope and holds value of url attribute. We can print the value hold by var attribute ouside <c:import> tag in the page.

Can someone confirm my understanding and clear about varReader attribute
Strange...there is no option of "null null" and "not even problem with DD".
Just wanted to clarify - Is it necessary to have <el-ignored> declared in DD if we using <@page isELIgnored="true" %>

If my JSP using the page directive to turn off EL but DD does not have <el-ignored>. That is fine - no errors.