Paranidharan Selvaraj

Greenhorn
+ Follow
since Mar 19, 2010
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Paranidharan Selvaraj

<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE8" />

I am using this meta tag for IE8 compatibilty... Again if my client migrates to IE9 and i have to keep changing this.. Instead i like to code for all the versions.

Is it feasible?

My issue has been setting the meta tag content depending on the version of IE 6, 7, 8, and later version.

if(navigator.appName == "Microsoft Internet Explorer"){
var meta = document.createElement('meta');
meta.setAttribute('http-equiv', 'X-UA-Compatible');
meta.setAttribute('content', 'IE=EmulateIE'+getIEVersionNumber());
document.getElementsByTagName('head')[0].appendChild(meta);
}

function getIEVersionNumber() {
if (/MSIE (\d+\.\d+);/.test(navigator.userAgent)){ //test for MSIE x.x;
var ieversion=new Number(RegExp.$1) // capture x.x portion and store as a number
return ieversion;
}
}

The meta tag appended has no effects. Can anyone suggest handling X-UA-Compatible for future releases.
We are recently switched to IE8. There are compatibility issues, so we included the meta tag,
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7" > and we modified css files.. It is working now. We need to work out the solution for the future release of IE also. Is there any specific way of doing it?
In my project we are using struts1.2 integrated with springs2.5 using DelegatingActionProxy.. Now we would like to use annotations instead to get rid of context xml files. We are facing an issue while converting to annotations when there are multiple url to the same action class.

/* works */

@Controller("/url")
public class MyAction extends ApplicationAction{

@Autowired @Qualifier("myService")
private MyServicemyService;
// code

}


/* doesnt work */

1.

@Controller("/url1,/url2")
public class MyMultipleURLAction extends ApplicationAction{

@Autowired @Qualifier("myService")
private MyServicemyService;
// code

}

2.

@Controller
@RequestMapping({"/url1","/url2"})
public class MyMultipleURLAction extends ApplicationAction{

@Autowired @Qualifier("myService")
private MyServicemyService;
// code

}

Is there a way for doing it?

13 years ago
I have a many to one relationship between 2 classes A and B(a->B). I want to use annotations unfortunately there are many classes to be converted in my project( hibernate + spring integrated ). I ended up changing only Class B to annotations and class A will have the old hbm mapping file itself..

While doing so i get an exception creating sessionFactory "An association from the table A refers to an unmapped class: B"

I am using AnnotationSessionFactoryBean.. Shown below is my context file.
<bean id="sessionFactory" class="org.springframework.orm.hibernate3.annotati on.AnnotationSessionFactoryBean">
<property name="configLocation">
<value>classpath:/hibernate.cfg.xml</value>
</property>
<property name="annotatedClasses">
<list>
<value>pack.MyClass</value>
</list>
</property>
</bean>

I was successfully annotating MyClass. Class A is having many-to-one association with Class B. Now i try to annotate class B and class A will have hbm mapping. I am not able to do it.
When deploying i get the error message as below:::

Caused by: org.hibernate.MappingException: An association from the table my_table1 refers to an unmapped class: pack.ClassB
at org.hibernate.cfg.Configuration.secondPassCompileF oreignKeys(Configuration.java:1258)
at org.hibernate.cfg.Configuration.secondPassCompile( Configuration.java:1176)
at org.hibernate.cfg.AnnotationConfiguration.secondPa ssCompile(AnnotationConfiguration.java:296)
at org.hibernate.cfg.Configuration.buildMappings(Conf iguration.java:1121)
at org.springframework.orm.hibernate3.LocalSessionFac toryBean.buildSessionFactory(LocalSessionFactoryBe an.java:674)
at org.springframework.orm.hibernate3.AbstractSession FactoryBean.afterPropertiesSet(AbstractSessionFact oryBean.java:211)
at org.springframework.beans.factory.support.Abstract AutowireCapableBeanFactory.invokeInitMethods(Abstr actAutowireCapableBeanFactory.java:1288)

Is it possible to annotate class B alone without annotating Class A?
We have a web application developed using sturts-springs framework.. We are now trying to annotate the classes by which we are avoiding extended application context xml configuration. My issue is how to use annotations for passing a list of property values.

ApplicationContext.xml

<bean name="/showAdminInbox" class="com.web.inbox.ShowAdminInboxAction">
<property name="inboxService" ref="inboxService" />
<property name="requiredPermissions">
<list>
<value>CR_PerformRating</value>
<value>CR_ApproveRating</value>
<value>CR_RerouteFinalApprover</value>
</list>
</property>
</bean>

Impl using Annotations:

@Component("/showAdminInbox")
public class ShowAdminInboxAction extends ApplicationAction{

@Autowired @Qualifier("inboxService")
private InboxService inboxService;

@Autowired @Qualifier("requiredPermissions");
// how to pass the list of values that is provided in xml file

}



how do i pass the collection values using annotations?
13 years ago
sorry for the delayed reply.. I have a textarea inside a div tag in jsp. On click of an image i use jquery modal dialogue to open the popup.

Jsp Code:

<div id='popup0' class="ui-widget-content ui-corner-all" title="Confidential Comments" style="display:none" >
<textarea name="accounts[0].justificationComments" style="width:480px ;height:150px;border:0px;">test </textarea>
</div>

My problem is i get the textarea in the popup. I am able to save/edit/close the modal window. One bug that is repeatedly bothering me is when i click on edit i am able to edit the content inside but without saving if i click the button close the value is retaining when i open the popup again. It should only happen if is use save button.

buttons: {

'Cancel': function() {
document.getElementById(imageDiv).style.display="none";
document.getElementById(checkboxId).checked=false;
document.getElementById(hiddenId).value= "";
$('input[type="text"], textarea').attr('readonly','');
$(this).dialog('close');
},
'Close': function() {
$('input[type="text"], textarea').attr('readonly','');
$(this).dialog('close');
},
'Save': function() {
var text = $(this).text();
document.getElementById(hiddenId).value= text;
$(":button:contains('Edit')").attr("disabled","");
$(this).dialog('close');
},
'Edit': function() {
$('input[type="text"], textarea').attr('readonly','');
$(":button:contains('Save')").show();
$(":button:contains('Edit')").attr("disabled","disabled");
return;
}
}
});

I have a popup modal dialogue... The user will be asked to enter the text inside the textarea of the popup. I have edit,save and close buttons.. User clicks edit and changes the text inside the textarea and opts to close without saving. When the user opens the popup again the value in the popup textarea is not retaining. I am using jquery to do this.

'Close': function() {
$('input[type="text"], textarea').attr('readonly','');
$(this).dialog('close');
}


I have tried setting the value again the textarea like
$(this).val("original text"); not succeeding though.
I am iterating a list and setting a property in the hidden field. List is iterated and displayed in viewable mode.. When i click on edit all the list items are shown editable... at this time i m getting an extra space because of hidden.. could you suggest a solution for this.
tried out z-index it is not solving the problem. I should not hide the select box as that is the part of requirement. Using bgiframe i am able to keep the popup dialogue on top but the select hides in the parent.. Is there a way to keep the popup on top without hiding any elements?
IE 6 is used by our client. I dont see the issue in IE 7,8 or Firefox. Please anyone help..
I am using IE6. On opening a dialogue using jQuery UI 1.7.1 the select box appears on top of this popup. On setting bgiframe : true i am seeing that select box disappears. Could someone help to fix this IE6?
Sorry guys.. i m a newbie.

I am using struts(ver 1.2) forms. i have a property which is a list.
<code>
<logic:iterate id="accounts" name="counterpartyForm" property="accounts" type = Account" >
</code>

I have an icon on click i open a popup using jquery.
<code>
<img src="icon.jpg" onclick="showPopup()">
</code>

<script>

function showPopup(){
$("#popup").dialog('open');
$("#popup").dialog({
bgiframe: false,
autoOpen:true,
resizable:true,
modal: true,
position: 'center',
height: 150,
width: 300,
buttons: {
'Cancel': function() {
$(this).dialog('close');
},
'Add/Update': function() {
var text = $('textarea').text();
var area = document.getElementsByName('accounts.justificationComments');
area.value = text;
$(this).dialog('close');
}

}
});
}
</script>


<code>
<div id="popup" class="ui-widget-content ui-corner-all" title="Add Justification Comments" style="display:none" >
<html:textarea name="accounts" property="justificationComments" style="width:250px" indexed="true"/>
</div>

The problem is i am not able to set the textarea value in the property.. Please suggest me a solution.
I have tried your solution.. not working. any suggestions
on click of the icon from the parent window i will popup a textarea using jquery.. I will enter text in the popup on submit i need to set the value in the form property.. I am not able to do it.. Any help would be appreciated. I am using struts tags in jsp.

function showPopup(){
$("#popup").dialog('open');
$("#popup").dialog({
bgiframe: false,
autoOpen:true,
resizable:true,
modal: true,
position: 'center',
height: 150,
width: 300,
buttons: {
'Cancel': function() {
$(this).dialog('close');
},
'Add/Update': function() {
$("button").click(function () {
var text = $('textarea').text();
$("justificationComments").val(text); // this line is not working. text is printed properly.
alert(text);// need to set this text value in justificationcomments property
});

$(this).dialog('close');

}

}
});
}

<form>
<img src="<%= request.getContextPath() %>/images/commentsicon.jpg" onclick="showPopup()">
<div id="popup" class="ui-widget-content ui-corner-all" title="Add Justification Comments" style="display:none" >
<html:textarea name="accounts" property="justificationComments" style="width:250px" indexed="true"/>
</div>
</form>