Krutika Ravi

Greenhorn
+ Follow
since Feb 11, 2010
Merit badge: grant badges
Biography
Stay Hungry.Stay Foolish.
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 Krutika Ravi

palak kumar wrote:i think you meant a book. this book is solely for the purpose of OCEJWCD(EE6). i have ordered this book yesterday for 501 rupees.

OCEJWCD Study Companion (Certification Study Guide) OCE Java EE Web Component Developer 2013 Edn
By BPB Publications
Lyons,Charles

if you are an indian than you need to mention the "BPB publications" in your search criteria. its available on ebay.in(520rupees), snapdeal(501rupees)

i hope that helps..



Hi Palak,

This book which you ordered, was it the 3rd edition or the 2nd?

Thanks
Krutika
Hi Frits,

I do get the Edit Option on the Comments I am posting now. But for the first Post I get to see only the Quote Button.

Problems which I face:
a) I try opening a page and ideally I should be directed to the Form but that ain't happening.
b) I tried using BASIC Authentication and I don't get a prompt either.
c) I downloaded a brand new Tomcat container and my code still fails to give me a prompt.

Thanks
Kind Regards
Krutika
Hi Fritz,

That doesn't help.

Correction:
In the above web.xml. Remove
<http-method><http-method>

Don't know where I am losing track.

Kind Regards
Krutika
Hi,

I have been working on Security Chapter and I have implemented the following code. Unable to identify the point of error. Kindly help.

Deployment Descriptor:


tomcat-users.xml


login.jsp
Thanks Bear. Was able to get it right using:
${myFirstTag:establishConnection('Gmail','imap.gmail.com','993', param["username"], param["password"])}

Kind Regards
Kru
Hi,

Quick Question: Can a param value using EL be used within an EL Function. For eg:
${myFirstTag:establishConnection('Gmail','imap.gmail.com','993',${param["username"]},${param["password"]})}

From the error I get I feel the system isn't able to differentiate between the curly braces

description: The server encountered an internal error (javax.el.ELException: Failed to parse the expression [${myFirstTag:establishConnection('Gmail','imap.gmail.com','993',${param["username"]}]) that prevented it from fulfilling this



Thanks
Kind Regards
Krutika
Thanks Bear. I see your point now.

Kind Regards
Kru
Hi,
I am building an simple Email Client for which I am implementing the concept of El Functions. The idea is on click of the submit button an EL Function gets called which is responsible for Connection with the Mail server. However on executing the following code I am unable to even view my login page. I get the following Exception:

javax.servlet.ServletException: java.lang.NoClassDefFoundError: javax/mail/AuthenticationFailedException
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:343)
javax.servlet.http.HttpServlet.service(HttpServlet.java:722)





jsp file:




.tld




Thanks

Krutika
Thank you Frits,
I realised that I was making changes in web.xml and the lines
<Connector protocol="org.apache.coyote.http11.Http11Protocol"
port="8443" SSLEnabled="true"
maxThreads="150" scheme="https" secure="true"
clientAuth="false" sslProtocol="TLS" />

were to be uncommented in server.xml.

Thanks for your help.
I have been preparing for the OCPJWCD Exam and have made it to the Web App Security Chapter of Bert Bate's HFSJ:

Question:
a) I'm unable to securely request for my webpage : https://127.0.0.1:8443/Blah , instead I get the following Error:

Firefox can't establish a connection to the server at localhost:8443.
The site could be temporarily unavailable or too busy. Try again in a few
moments.
If you are unable to load any pages, check your computer's network
connection.
If your computer or network is protected by a firewall or proxy, make sure
that Firefox is permitted to access the Web.


On Internet Explorer I simply get:
Internet Explorer cannot display the webpage

b) How do I know which SSL Implementation my tomcat is making use of: JSE/APR

Details:

web.xml

<?xml version="1.0"?>
<!DOCTYPE web-app PUBLIC
"-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
"http://java.sun.com/dtd/web-app_2_3.dtd">

<web-app
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="http://java.sun.com/xml/ns/javaee"
xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
id="Your_WebApp_ID"
version="2.5">

<description>The standard web descriptor for the email client</description>

<servlet>
<servlet-name>AuthenticateUser</servlet-name>
<servlet-class>MailBoxController</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>AuthenticateUser</servlet-name>
<url-pattern>/ControlPanel</url-pattern>
</servlet-mapping>
<welcome-file-list>
<welcome-file>login.jsp</welcome-file>
</welcome-file-list>
<error-page>
<error-code>401</error-code>
<location>/authenticationFailed.jsp</location>
</error-page>
<context-param>
<param-name>serverName</param-name>
<param-value>Gmail</param-value>
</context-param>
<context-param>
<param-name>port</param-name>
<param-value>993</param-value>
</context-param>
<context-param>
<param-name>ip</param-name>
<param-value>imap.gmail.com</param-value>
</context-param>

<session-config>
<session-timeout>30</session-timeout>
</session-config>

<listener>
<listener-class>Logger</listener-class>
</listener>

<security-constraint>
<web-resource-collection>
<url-pattern>/*</url-pattern>
<http-method>POST</http-method>
</web-resource-collection>

<auth-constraint>
<role-name>administrator</role-name>
</auth-constraint>

<user-data-constraint>
<transport-guarantee>CONFIDENTIAL</transport-guarantee>
</user-data-constraint>
</security-constraint>

<login-config>
<auth-method>BASIC</auth-method>
</login-config>

<security-role>
<role-name>administrator</role-name>
</security-role>

</web-app>

tomcat-users.xml :

<tomcat-users>
<role rolename="administrator"/>
<user username="admin" password="system123#" roles="administrator"/>
</tomcat-users>

Following tag was added in web.xml in conf of tomcat :

<-- Define a SSL Coyote HTTP/1.1 Connector on port 8443 -->
<Connector
protocol="org.apache.coyote.http11.Http11NioProtocol"
port="8443" maxThreads="200"
scheme="https" secure="true" SSLEnabled="true"
keystoreFile="C:/Users/.keystore" keystorePass="changeit"
clientAuth="false" sslProtocol="TLS"/>


Can anybody please help me with my problem.

Thanks
Krutika
Thats because, barring the file ftmyersbeach_data.zip no access rights have been provided be it directories or files. Its just this sole file.

Yes thats why I was avoiding sharing it in the first place..

Following is the second approach with the URL specified again (you can remove it, just wanted to provide clarity if that could help):




Could anybody help me... I really don't get what is the browser's approach and how is it any different from mine..
Or any other workaround - something similar to calling this url via a browser maybe?

Regards,
Kru
With approach two I face the following exception:

Here1:ftp://URL REDACTED/
java.net.UnknownHostException: ftp:/URL REDACTED/
at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:195)
at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:366)
at java.net.Socket.connect(Socket.java:529)
at java.net.Socket.connect(Socket.java:478)
at java.net.Socket.<init>(Socket.java:375)
at java.net.Socket.<init>(Socket.java:189)
at org.apache.commons.net.DefaultSocketFactory.createSocket(DefaultSocketFactory.java:52)
at org.apache.commons.net.SocketClient.connect(SocketClient.java:161)
at org.apache.commons.net.SocketClient.connect(SocketClient.java:249)
at ftpdownloaddemo.FtpDownloadDemo.main(FtpDownloadDemo.java:33)
Exception in thread "main" java.lang.NullPointerException
at org.apache.commons.net.telnet.TelnetClient.disconnect(TelnetClient.java:124)
at org.apache.commons.net.ftp.FTP.disconnect(FTP.java:361)
at org.apache.commons.net.ftp.FTPClient.disconnect(FTPClient.java:562)
at ftpdownloaddemo.FtpDownloadDemo.main(FtpDownloadDemo.java:84)
Java Result: 1


Thanks..
Krutika
Hie Joe,

The slash i missed out was a typo and I have tried the url with the type specification i.e type=d and without it (i.e the actual password embedded url) and none work with both approach. Surprisingly when I try and download the file by making use of the same url I face no hassles i face in downloading the file.

URL : URL redacted, though it looks correct JCE

The exception I encounter is:
java.io.FileNotFoundException:URL REDACTED/ftmyersbeach_data.zip
at sun.net.www.protocol.ftp.FtpURLConnection.getInputStream(FtpURLConnection.java:441)
Hi,

I have been trying to download a file from the ftp server, barring it none of the other files or the directories have been assigned any access rights. Now when I try and download this file from the browser with the filepath appended to the url I face no problem. Whereas when I try to download it via the Java code I face access related exception. The reason I understand is that since the code makes connection with the server first and then checks for directory rights(which are false in this case) I'm unable to download the file.
Could anyone help me understand what procedure the browser might be making use that it is allowed to download the file even though the parent directories of this file have no rights? Or if anybody can suggest an alternative approach then nothing like it.


I have attempted to download th file by making use of the following approach:

Approach 1 :


Approach 2:



Thanks a lot.
Krutika
Brilliant Idea Sahil!!!
13 years ago