Chuck Meduri

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

Recent posts by Chuck Meduri

Hi,
I need to protect a bunch of jsps which need to be accessed only when somebody logs in to the application and prevent users from directly typing in the URL with http://hostname/anypage.jsp instead of https://hostname/anypage.jsp. How can I acheive this? I am using IIS as the web server and IBM Websphere4.0 as the application server.
Right now once an user logs in, the user is redirected to an application.jsp page through a servlet(the url is https://hostname/application.jsp). Once you get to this page, the user is able to type in http://hostname/application.jsp and able to continue with the proces. I want to show an user the error page when the user types in http:// instead of https://
How can I acheive this? How to protect those files? How can I 'sslProtect' these JSP files? Can any one help me to solve this............
I have looking at the Websphere documentation and all places on the web but haven't been to see any documentation or help.
Thanks in advance for all the help.
Chuck Meduri
22 years ago
Hi,
I believe as long as it is a Collection or an Enumeration, you should be fine...
Chuck
Hi Kyle,
Thanks for the info. That worked for me.
But I thought that narrow was to be used in EJB 1.0 and not in EJB1.1.
Chuck
Hi,
I have written a bean managed persistence bean and have a business method which returns the number of records for a particular user in the form of an enumeration of records. I use JDBC to access the database. Everything is working correctly. When I hop through the enumeration getting each element in the enumeration and call the getter on the businessObject, I also get the right information which is then displayed in a table. Since it was taking a long time to get even few records, I put some system outs in my ejbStore and ejbLoad methods and have the usual jdbc stuff in these methods to update and do a select from the database, to find out where the bottleneck was.
My question is -- every time I call the getter methods on the businessObjects while printing out the information from each businessObject during my hoping in the enumeration, my log files show that the ejbStore method and the ejbLoad method is called every single time I go through the while loop until there are no more elements in the enumeration. Isn't this a heavy strain on the database and the connectivity to basically obtain a connection and do a update each time? Or is there something I am missing here? My log files are growing enormously big even when the number of records returned is pretty small say 10 or 15 records.
Could somebody help me explain as to why the ejbstore and the ejbLoad method are getting called each time the while loop is entered when trying to display the data.
Thanks you in advance,
Chuck
Hi,
I have a servlet through which I am making calls to a EJB.
My home interface has a function 'findAllRecords' which returns an enumeration of PrimaryKeys. I am able to 'lookup' my home interface, call the 'findAllRecords' function on my home interface. When I get the enumeration, I also am sure that I have records in that enumeration. When I hop through the enumeration using next element - from what I read in the Haefel book, I am supposed to get the RemoteInterface of my bean.
My problem is that I am getting a ClassCastException 'org.omg.stub.javax.ejb._EJBObject_Stub' when I get the next element from the enumeration.
I am currently using EJB1.1, VisualAge For java and Websphere Application Server.
Can anyone help me understand why I am getting this Exception and how can I solve this problem?
Thanks in advance,
Chuck
Hi everyone,
I have two windows one of which is a class extending JPanel(let's call this PanelA) and the other which is opened(let's call it DialogB) by clicking a button on PanelA. BTW, DialogB extends JDialog. DialogB has a table where the user can select a row and click a button 'Add' which adds the selected row to a table in PanelA.
This was working pretty well when we are developing JDK1.1.7. When we migrated to JDK1.2.2, this update when selecting a row in DialogB and clicking a 'Add' button does not update the table in PanelA.
I am having to close DialogB and resize 'PanelA' to actually see the added row. Whereas I was able to see it immediately in the older version of JDK.
I have tried repaint and resizing on the parentPanel of DialogB which happens to be 'PanelA' and still this is doing the trick.
Can anyone help me with this problem?
Any suggestion would be appreciated.
Thank you in advance,
Chuck
23 years ago
Hi,
How do you determine if a frame is child frame?
Thanks,
Chuck
Hi,
I am using Websphere application Server 4.0 and having JSP 1.1 code.
When I try to run this JSP, it gives me a ClassCastException.
Does anybody have an idea as to how to solve this problem.
All that the JSP has is a simple JSP declaration such as
<%! StringBuffer x = new StringBuffer()%>
Thanks
23 years ago
JSP
Hi Manfred,
This applet was working fine in Visual Age for Java 3.0 version which uses JDK 1.1.7. Recently we are upgrading our VisualAge For Java, Web Application Server etc... The VisualAge For Java(VAJ) 4.0 uses JDK 1.2.2.
This meat of the applet is trying to attempt logging in any user. Inside the attemptLogin function in this applet class, it creates a new LoginThread(which extends thread), and shows the progress bar.
This was working perfectly in the old version. But in the newer version which uses the JDK 1.2.x, it throws the exception that I posted. The reason being it does not have the access to modify the thread. I created a new policy file granting permission to modifyThreadGroup at Runtime etc. But this has not helped either.
I am still at loss of ways to solve this problem.
Any help would be appreciated.
Regards,
Chuck
P.S: I am also looking at the thread you just me to see if I can implement something similar.

Originally posted by Manfred Leonhardt:
Hi Chuck,
Not sure what you are trying to implement. But take a look at the following thread to see if it can help you.
http://www.javaranch.com/ubb/Forum2/HTML/003306.html
Regards,
Manfred.


23 years ago
Hi,
I had an applet which was running fine with the security features in JDK 1.1. When running the same applet code in JDK 1.2 (I guess the java security 1.2 is implemented), I get the following exception:
java.security.AccessControlException: access denied (java.lang.RuntimePermission modifyThreadGroup )
java.lang.Throwable(java.lang.String)
java.lang.Exception(java.lang.String)
java.lang.RuntimeException(java.lang.String)
java.lang.SecurityException(java.lang.String)
java.security.AccessControlException(java.lang.String, java.security.Permission)
void java.security.AccessControlContext.checkPermission(java.security.Permission)
void java.security.AccessController.checkPermission(java.security.Permission)
void java.lang.SecurityManager.checkPermission(java.security.Permission)
void sun.applet.AppletSecurity.checkAccess(java.lang.ThreadGroup)
void java.lang.ThreadGroup.checkAccess()
void java.lang.Thread.init(java.lang.ThreadGroup, java.lang.Runnable, java.lang.String)
java.lang.Thread()
Does anyone out there have any idea as to how to resolve this issue?
I read the security architecture and changed the java.policy file in the {$java.home}\jre\lib\security directory and ran the applet code. It still give the same error.
Can anyone help me? Any help would be appreciated.
Chuck
23 years ago
Hi,
I have a form in which I have a selection box, along with a text box. The user can either pick a selection from the list and/or can enter something into the text box and submit the form.
When I first open the form, the first element in the list(in this case 1) is selected.
What I would like to do is to leave the top of the list in the selection box empty so that when the form is opened, the first element in the selection box is not displayed instead it is empty
and the user can then select from the list so that it is visible
Can I acheive this in HTML?
Thanks,
Chuck
Hello everyone,
Given below is the code that I am using to submit a Form (which is actually a JSP) to the server anytime I hit the enter key.
I have a number of checks for each field on the form that I validate using javascript.
When I enter a wrong value into one of the text boxes and hit the enter key, it validates that field and displays an alert box that the format of that field is wrong, but still submits the form to the server.
Could anybody help me with understand why this could be happening?
Chuck
---------------------------------------------------
netscape = "";
ver = navigator.appVersion; len = ver.length;
for(iln = 0; iln < len; iln++) if (ver.charAt(iln) == "(") break;
netscape = (ver.charAt(iln+1).toUpperCase() != "C");
function keyDown(DnEvents)
{// handles keypress
// determines whether Netscape or Internet Explorer
k = (netscape) ? DnEvents.which : window.event.keyCode;
if (k == 13) {// enter key pressed
submitRequest();
}
}
---------------------------------------------------------
Hi everyone,
I am trying to make a text input field in a form readonly when I select a particular radio button.
I used the foll. code to for this functionlity:
function changeTextField(typeOfRadioButtonClicked){
if(typeOfRadioButtonClicked == 1){
document.<formName>.<fieldName>.readOnly = true;
}
else if(typeOfRadioButtonClicked == 2){
document.<formName>.<fieldName>.readOnly = false;
}
}
I do not want to disable this text input field as I need to send these value to the server for further processing.
This works perfectly fine in IE but does not work in Netscape.
Can anybody give me hints as to how I can this functionality in Netscape?
Thank you
Chuck
Cameron,
The reason the entire frame changes to listRoomPath is because the target on that form says "top".
I think it will work as you want if you have the target on that form as "self" i.e
<FORM METHOD="POST" ACTION=response.encodeURL(listRoomPath)
TARGET="_self">
Hope that helps.
Chuck

Originally posted by Cameron Park:
I have the following snippet in the second form:out.println("<HTML>");
out.println("<BODY>");
out.println("<FORM METHOD=\"POST\" ACTION =\""+response.encodeURL(chatRoomPath)+
"\" TARGET=\"_top\">");
out.println("<p>Enter your message:</p>");
out.println("<INPUT TYPE NAME=\"msg\" SIZE=\"30\">");

out.println("<INPUT TYPE=SUBMIT VALUE ='Send Message'>");
out.println("</FORM>");
out.println("<FORM METHOD=\"POST\" ACTION = \""+response.encodeURL(listRoomPath)+
"\" TARGET=\"_top\">");
out.println("<INPUT TYPE=SUBMIT VALUE=Exit>");
out.println("</FORM>");
out.println("</BODY></HTML>");
When I press the Exit button, the entire frame changed to listRoomPath.
Please help me understanding what is going on.


Hi,
I am trying to highlight the row in a table when you click on the checkbox which happens to be the first column. This particular HTML file contains a bunch of forms. The code given below is a concise one:

<HTML>
<HEAD>
<link rel="STYLESHEET" type="text/css" href="ips.css">
<style>
td {border-right: 2px lightgrey solid}
.cover { background: navy; color: pink}
.rover { background: #ffb164; color:white}
</style>
<SCRIPT LANGUAGE="JavaScript">
<!--
var rowHighlight = true;
var colHighlight = false;
function getElement(e1)
{
var tagList = new Object;
for ( var i=1; i<arguments.length; i++ ) {
tagList[arguments[i]] = true;
}
while((e1!=null) && (tagList[e1.tagName] == null))
{
e1 = e1.parentElement;
}
return e1;
}
function highlight(which)
{
var e1 = null;
if(navigator.appName.indexOf("Microsoft") != -1){
e1 = getElement(event.srcElement, "TH", "TD");
}
if(e1 == null) return;
if((e1.tagName=="TD") && (rowHighlight))
{
var row = getElement(e1, "TR");
var table = getElement(row, "TABLE");
if(which)
row.className = "rover";
else
row.className = "";
}
}
function checkBoxHighlighting(index)
{
if(document.adjustmentsForm.SelectedAdjstmts[index].checked=="1")
highlight(true);
else
highlight(false);
}

// -->
</SCRIPT>
</HEAD>
<BODY>
<NOSCRIPT>
<B>This page is enhanced by and therefore requires JavaScript. Upgrade to the latest version of Netscape Navigator
or Microsoft Internet Explorer.</B><P>
<P>
If you are using a JavaScript supported browser, be sure you have enabled JavaScript
in the Preferences/Options dialog box.<P>
</NOSCRIPT>
<FORM NAME="form1" METHOD="POST" target="_self">
<TABLE border="0" width="700" height="0%" CELLSPACING="0" CELLPADDING="0">
<TR VALIGN="TOP"><TD VALIGN="TOP">
<TABLE border="0" width="700" bgcolor="#006699" cellpadding="0" cellspacing="1">
<TR bgcolor="#ffffff" height="20">
<TD><INPUT type="checkbox" NAME="SelectedAdjstmts" VALUE=0 onClick="javascript:checkBoxHighlighting(0)"></TD>
<TD><IMG NAME="Image0" BORDER="0"></TD>
<TD align="center"><B>1</B></TD>
<TD align="center"><B>xxxxx</B></TD>
<TD align="center"><B>xxxxxx</B></TD>
<TD align="center"><B></B></TD>
<TD align="center"><B>xxxx</B></TD>
<TD align="center"><B>xxxx/xxxx</B></TD>
<TD><B></B></TD>
</TR>
</TABLE>
</td>
</tr>
</TABLE>
<INPUT TYPE="HIDDEN" NAME="formName" VALUE="form1">
</FORM>
<FORM NAME="form2" METHOD="POST" target="_self">
<INPUT TYPE="HIDDEN" NAME="a" VALUE="">
<INPUT TYPE="HIDDEN" NAME="b" VALUE="">
<INPUT TYPE="HIDDEN" NAME="formName" VALUE="2">
</FORM>
<FORM NAME="form3" METHOD="POST" target="_self">
<INPUT TYPE="HIDDEN" NAME="formName" VALUE="3">
</FORM>
<FORM NAME="form4" METHOD="POST" target="_top">
<INPUT TYPE="HIDDEN" NAME="formName" VALUE="4">
</FORM>

</CENTER>
</BODY>
</HTML>

The problem I am running into is sometimes, I keep getting a javascript error which says
'document.adjustmentsForm.SelectedAdjstmts[...].checked' is null or not an object'
At other times, it seems to work fine highlighting the row when I click on the checkbox and remove the highlighting when I uncheck the checkbox.
Can anybody help me as to how I can get rid of this error message. I am working with IE 6.0 and I have seen this happening only sometime on IE 5.0 and IE 5.5
Thank you,
Chuck