David Cox

Greenhorn
+ Follow
since Mar 22, 2005
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 David Cox

HI all,

I am expereancing a problem,

I am using modules (sub-application).It started when i introduce modules in my app.

I am getting the following error message:



Any suggestions on what might be causing this?
[ May 09, 2005: Message edited by: David Cox ]
19 years ago

Originally posted by Bear Bibeault:
Have you performed the basic debugging step of doing a View Source of the page when it is misbehaving to see if the HTML is formatted correctly? Have you done a side-by-side comparison of the HTML when it appears correctly and when it does not?

This step could very well tell you where the problem lies.



I'll do that and tell you the result.

Thanks,
DC
19 years ago
JSP

Originally posted by Adeel Ansari:
Ok. After getting that page without CSS, just refresh it using browser refresh button and then see whether it appears with CSS or not?



It's all same with refresh.

DC
19 years ago
JSP


If excludetList(Hashtable) contain the path of the request(request.getServletPath()) if block will be executed, otherwise else block will be executed.

I dont have problom here. The if and else blocks and Filter works fine, Only problom is redirected Page does'nt show CSS effect.

What you think?.

Thanks,
DC
[ April 27, 2005: Message edited by: David Cox ]
19 years ago
JSP

Originally posted by Ben Souther:
Can you post the location of the two pages and the css sheet?
Are both JSPs in the same context?

Post the paths on the server and the URLs used to reach both.




myWebApp/ShowHomePage.jsp
myWebApp/Register.jsp
myWebApp/theme/newcss.css

http://localhost:8880/myWebApp/ShowHomePage.jsp
http://localhost:8880/myWebApp/Register.jsp

They all in same context. When i hit

http://localhost:8880/myWebApp/Register.jsp without using the Filter(Filter using sendRedirect) in browser, it shows CSS effect.

But when Filter enabled, if i try to access http://localhost:8880/myWebApp/ShowHomePage.jsp, the Filter redirects the browser to http://localhost:8880/myWebApp/Register.jsp using sendRedirect. the Register.jsp is displaying without CSS!.

It seems strange and it become stranger,

i use,



in Filter class,the results are,

/scripts/global.js
/scripts/login_views.jsp
/theme/newcss.css
/ShowHomePage.jsp

STRANGE!!!.

i never HIT http://localhost:8880/myWebApp/scripts/global.js in my browser!!.sendRedirect sends these URI's to the server!!.

I took care to add a return statement after sendRedirect call.

What you thinks?

Thanks,
DC
19 years ago
JSP

Originally posted by Bear Bibeault:
<link href="/contextname/theme/newcss.css" rel="stylesheet" type="text/css"/>

Where contextname is the name of the app context and the theme folder is at the root of the web app base. (If not, insert the appropriate folder hierarchy).

To obtain the context name programatically you can use request.getContextPath() in JSP 1.x or ${pageContext.request.contextPath} in JSP 2.0.



Hi Bear,

I put the following in my code, But still the result is same!.



After inserting context path, when i call Register.jsp(for example) without sendRedirect(By hitting URL in browser) the page does'nt get CSS effect.

But without inserting context path, calling Register.jsp from browser gives CSS effect.But with sendRedirect does'nt give CSS style.

So the problom is very related to sendRedirect. Any ideas?.

Thanks,
DC
19 years ago
JSP

Originally posted by Ben Souther:
Look at your browser's address window.

What is the difference in the URL when you hit it directly and when you come to it by the way of a re-direct?



SAME..No difference at all,

Originally posted by Bear Bibeault:
Most likely you are using a page-relative reference to the CSS file that is not resolving correctly.



Yes..i dont add CSS class statements in evry HTML tags. But only use,

<LINK href="theme/newcss.css" rel="stylesheet" type="text/css">

So how can i resolve this issue?.

Thanks,
DC
19 years ago
JSP
Hi everybody,

I am experiancing strange problom.

I have a Filter which is redirects the user request to a perticular page according to some conditions.

I get everything right with sendRedirect,but the resulting page does'nt coming with CSS styles.

For example, if i redirects to Register.jsp,the actual page(Register.jsp) look nice with CSS.But when the page displays as the effect of sendRedirect,the page comes as only HTML. CSS styles are not including.

Why this behavior?.

Thanks,
DC
[ April 26, 2005: Message edited by: Bear Bibeault ]
19 years ago
JSP

Originally posted by Nathaniel Stoddard:
Interesting. The only hunch I have is that maybe the XXXX forward is setup to issue a redirect to the browser. (Then, the ActionErrors which were stored in the request would be lost by the time it gets to the correct JSP). So, did you set redirect="true"?

Other than that, I have no idea.



Fantastic!!. I never bothered about redirect issue.

Thanks.
DC
19 years ago
Hi,

Seems a common problom,Read a lot of articles on it.But could'nt find an answer.

I am using this code in execute(...) method,



Then i use <html:errors/> in JSP.

But the error messages does'nt come in my JSP page.But if i use this code instead,i get the error messages in JSP page.



If i add

The code works fine.I am getting error messages in my JSP page.I dont understand the behavior.

Anybody knows why?.

Thanks
DC
[ April 12, 2005: Message edited by: David Cox ]
19 years ago
Hi,

I am getting some errors with Struts.Maybe simple,

1) I have used the earlier version of struts.jar(which was 487 KB Version 1.1?) to develop a major part of my application.Now i have replaced my struts.jar to newer one(Which is 515 KB(Version 1.2)). But when i load pages in browser,i get this error,

javax.servlet.ServletException: Servlet.init() for servlet action threw exception

root cause

java.lang.NoSuchMethodError: org.apache.commons.validator.ValidatorResources.([Ljava/io/InputStream V
at org.apache.struts.validator.ValidatorPlugIn.initResources(ValidatorPlugIn.java:233)
at org.apache.struts.validator.ValidatorPlugIn.init(ValidatorPlugIn.java:164)

...


2)I am having an ActionForm which uses Struts(commons) validation through validation.xml.When i use client side validation inserting

<html:javascript formName="MyForm"/> It works FINE.

But when i remove client side validation,Serverside is not validating the form.

Anybody know what i am missing?

Thanks
DC
19 years ago
I got solution myself. I use Integer than int.

Moderators can close this thread now.

Thanks.
19 years ago
Hi,

I have an ActionForm which having some variables in type int.

When i display page of this ActionForm,I get these int fields populated with 0.

That is,Suppose i have a field for age entry, the browser page to the form is prepopulated with 0.I know that this happens because the default value of an int is 0.

This creates me probloms when validation.The firld never acts as empty.So i cannot use "required" validation rule.

Anyone knows how to get rid of this?.
19 years ago
Open a URLConnection (or HttpURLConnection) to CustInfo.jsp,
use the getInputStream() method to get a reference to the input stream for the jsp,
read this stream (which will be the HTML for CustInfo.jsp) into the String.
[ March 23, 2005: Message edited by: David Cox ]
19 years ago
JSP
I would like to associate different actions to one <html:form>, depending which submitButton was clicked on.

For example five submit buttons in one <html:form> and each submit button activates a different Action.Anybody know a good solution?.
[ March 22, 2005: Message edited by: David Cox ]
19 years ago