Win a copy of Micro Frontends in Action this week in the Server-Side JavaScript and NodeJS forum!

Nikhil Bansal

Ranch Hand
+ Follow
since Jan 24, 2005
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 Nikhil Bansal

Hi All,

Need some urgent help.

We are having a javascript which is throwing the foll error

"Object doesn't support this property or method".

The javascript function being called is using a Scanner API. So this is using some ActiveX.


Below is the code for javascript

There is a object tag in html

<object id="Scanner"></object>

The javascript functions are called from body tag.

Can someone please provide some help.

Thanks,
Nikhil

Hi All,

I have a JSP. Whenever, we submit the JSP and with all the fields filled, it inserts a new record in the DB.

Following is the form tag

<form name="Sorder" action="/sales/urn/show/maintain.do" method="post">

However, whenever the user presses the Refresh icon from the toolbar or does a right-click + refresh, it calls the action which inserts a new record in the DB. We want this not to happen i.e. whenever refresh is called, the action should not be performed.

Please if someone can guide me how to do this.

Thanks,
Nikhil
9 years ago
JSP
Can someone post a suggestion please.

Nikhil
9 years ago
Hi Steve,

I digged in the application and found the following.

This is stored in factory-config.xml

<factoryClass name = "referBackStatus"
singleton = "false"
className = "com.ezy.psa.isacore.uiclass.b2b.referBack.ReferBackStatusUI" />


Now the issue is that referBackStatus is being used to display a few buttons.

<% ResultData navBut = new ResultData( st.navButtons );%>

Can you please let me know where can I find st.navButtons ? I mean where these button labels might be stored ? Again some xml, or some properties file

Thanks,
Nikhil
9 years ago
Any inputs, anyone.

Nikhil
9 years ago
Hi Joe,

I might be wrong in posting this query to this forum.

However, looking at this piece of code

ReferBackStatusBaseUI st = (ReferBackStatusBaseUI)GenericFactory.getInstance("referBackStatus");

where should I look for "referBackStatus". What does this parameter mean wrt GenericFactory ?

Also, since the object reference st gets the labels of buttons using st, where should I look for these labels....in some properties file or some xmls.

Nikhil
9 years ago
Hi All,

I am new to Struts and need some help.

I have a piece of code

ReferBackStatusBaseUI st = (ReferBackStatusBaseUI)GenericFactory.getInstance("referBackStatus");

I wanted to understand where referBackStatus is being maintained. Is it being maintained in some XML or some properties file.

The thing is that the object st is referring to a few buttons and I would like to change their labels.

Please if someone can help.

Thanks,
Nikhil
9 years ago
Hi Lucas,

Ok. Will try printing the trace.

However, as I stated, that the issue is sporadic, happening once or twice in 2-3 weeks, with no specific pattern, could there be any other reason. The reference no returned from the backend is set in user's session in action class and is then displayed to the user.

Could there be a session problem as well ?

Thanks,
Nikhil
9 years ago
Hi All,

We are having a strange issue.

There is currently a JSP having few fields and the request is sent to a backend procedure which fetches the JSP fields and creates a record in backend and returns a reference number to the user which is displayed as a result to the user like "Your reference no is : 1234567"

The application is working fine. However, only at a few times, null is being shown to the user, like Your reference no is : null. This is happening only a few times, something once or twice in a week and there is no straight pattern to it.

Can someone please let me know how to go about it.

Thanks,
Nikhil
9 years ago
Hi Mark,

Thanks for the reply.

Can you post me some links for Strings.I need to clear my concepts for Interning strings.

Regards

Nikhil
Hi All,

Please give the output for the foll code and with reasons.

class MWC114 {
public static void main(String[] s) {
String s1 = new String("ABCDEFG"), s2 = new String("EFGHIJ");
String s3 = s1.substring(4,7), s4 = s2.substring(0,3);
System.out.println((s3 == s4) + "," + (s3 + s4).equals(s4 + s3));
}}

I feel that since s3 = "EFG" and s4 = "EFG", then these two Strings are interned and thus s3 and s4 point to the same String object. So the result of s3 == s4 must be true.

Regards

Nikhil Bansal

Regards

Nikhil Bansal
Hi All,

Look at the foll. code

class MCZ24 {
public static void main (String[] args) {
char a = 061; // 1
char b = '\61'; // 2
char c = '\061'; // 3
char d = 0x0031; // 4
char e = '\u0031'; // 5
System.out.print(""+a+b+c+d+e);
}}

Howcome statements 2 and 3 are valid?

Regards

Nikhil Bansal
Hi All,

Look at the foll. code

class MCZ24 {
public static void main (String[] args) {
char a = 061; // 1
char b = '\61'; // 2
char c = '\061'; // 3
char d = 0x0031; // 4
char e = '\u0031'; // 5
System.out.print(""+a+b+c+d+e);
}}

Howcome statements 2 and 3 are valid?

Regards

Nikhil Bansal
Hi All,

Cionsider the foll.

float b = 1L;

I feel that the above stmt will not compile as a long value is being assigned to a float.As far as I know any integer value can be assigned to a float without any cast and without specifiying F or f after the literal value.

Please throw more light on this.

Regards

Nikhil Bansal
Hi All,

Consider the foll. code:

class GRC4 {public static void main(String[] args) {}} // 1
class GRC5 {public static void main(String []args) {}} // 2
class GRC6 {public static void main(String args[]) {}} // 3

The code compiles and runs fine. So does this mean that any class can have main method. Also what if class GRC4 is marked as public, then will the code compile and run. And what if all the classes are marked as public.

Regards

Nikhil Bansal