Win a copy of Terraform in Action this week in the Cloud forum!

Likos Anthropous

Greenhorn
+ Follow
since May 06, 2013
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
1
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Likos Anthropous

Bear Bibeault wrote:Why is your filter even mapped for any static resource? You shouldn't even have images, scripts or stylesheets going through the filter.



Well, this is some kind of "inherited code"..., but now it seems that I found where the mistake was...

As you can see there is an if sentence that checks the file extension and in case of .gif and .jpg, it allows the file to go through... I also included here .css and .js files and now these resources are loaded...

Is that what you meant by mapping static resources?

I don't know if this is the best way to proceed, maybe not, but at least the problem is solved...


Thank you Jeanne, Paul & Bear for all our support.
8 years ago
JSP

Paul Clapham wrote:Do you perhaps have a filter which specifies "text/html" as the MIME type, and which is being applied to your CSS and JS files?



Thanks for your answer Paul.

I do have a filter but I belive has nothing to do with the MIME type. Anyway I post the code below, just in case you note something odd...



8 years ago
JSP

Bear Bibeault wrote:What is serving these resources?



I'm using Apache Tomcat 7.0.34.0. The JSP page is loaded from a servlet through the following code:



Hope it helps.

Thanks.
8 years ago
JSP

Bear Bibeault wrote:IE is notorious for misleading messages. I'd open the page in Chrome and use its network tools.

Also, I'd advise against using page-relative URLs to refer to the resources. See the JspFaq for more info.



Thanks Bear,

I changed the resources path using ${pageContext.request.contextPath}, now remains like this:



But now the messages I get in the Google Chrome Console are the following:

Resource interpreted as Stylesheet but transferred with MIME type text/html: "http://localhost:8084/Shambala/Estilos/lksMenuSkin3.css". localhost/:16
Resource interpreted as Stylesheet but transferred with MIME type text/html: "http://localhost:8084/Shambala/Estilos/styleCSS3Menu.css". localhost/:17
Resource interpreted as Stylesheet but transferred with MIME type text/html: "http://localhost:8084/Shambala/Estilos/validacion.css". localhost/:18
Resource interpreted as Script but transferred with MIME type text/html: "http://localhost:8084/Shambala/JS/jquery-1.4.2.min.js". localhost/:20
Resource interpreted as Script but transferred with MIME type text/html: "http://localhost:8084/Shambala/JS/jquery.lksMenu.js". localhost/:20
Resource interpreted as Stylesheet but transferred with MIME type text/html: "http://localhost:8084/Shambala/Estilos/style.css".


I think we'e getting closer...

Thanks.

8 years ago
JSP

Jeanne Boyarsky wrote:Could your server be sending back a http header with each of the requests? Maybe it defaults to a specific MIME type?



Dear Jeanne,

Thank you very much for your quick response. I'm using Apache Tomcat 7.0.34.0 and I did not have this situation in any of my previous experiences.

Sorry but, as I'm not very much experienced yet in Web Programming, I don't know how to check the header sent back by the server :(...

Thanks again.

Regards.
8 years ago
JSP
Dear colleagues,

I’m seeking help to try to solve a problem that is desperating me!!!

I have a JSP where I include the following CSS and JavaScript files like this:



It seems that everything must be OK, but the JSP appears on the navigator, I realize that the CSS and JavaScript files are ignored…

In the IE Web Console I get the error message “"CSS was ignored due to mime type mismatch" …

I can’t understand the reason of this message. As you can see, I state rel="stylesheet" type="text/css" .

It must be something very stupid, but so far I was not able to find the root of this error.

Hope someone could give me a helping hand…

Thank you very much in advance for your attention.

Kind regards.

8 years ago
JSP
Thanks for your advise :)...
8 years ago
JSP

Bear Bibeault wrote:Are there any scripting errors displayed on the JavaScript console?

With the statement hard-coded into the ready handler, the message should appear every time the page loads.

Did you also install the gritter images and CSS correctly?

To make it conditional, only include the statement when you want it to appear using <c:if> (rather than Java scriptlets, which you should not be using on your page.)



No errors on the JS console , I made sure that the css and js files are correctly located, I'm not familiar with that <c:if> you mentioned... It's OK, I don't want to take your time any longer for something that must be very easy to use.

So, thank you very much for your efforts, which I appreciate very much. Maybe I'll come back to this later on, when I'll have more time to dedicate...

Regards.

8 years ago
JSP
With the code above the message does not appear. I want the message to be sent when the if condition is true, how can I do it please?

Thanks.
8 years ago
JSP
Thanks Bear,

It seems to be quite easy but I do not yet catch it completely :(

I post below the JSP code where I'm trying to use this. I must be missing something....

Thanks again for your help.



8 years ago
JSP
Thanks again.

Please, how can I do to post code in the format you did?, whit that kind of indentation?

Thanks.
8 years ago
JSP

Bear Bibeault wrote:

Likos Anthropous wrote:Well, in fact this is for what I was searching some help..


Has all this not helped?

If you decide to go with Gritter, it's one line of script to add a notification.



Thanks Bear,

I've been tryimg to find out how to do it with Gritter. I found out some examples, but I see always the popup message is triggered after the usser press a link or a button. In my case, I want to send the message depending on the value of a session parameter, I could not find anything illustrative :). On top of this, again, I'm not familiar with jquery...

Could someone provide a short example of how to implement this with Gritter?

Thanks again.
8 years ago
JSP

Bear Bibeault wrote:Remember, figure out how to get all this working in HTML and JavaScript first. Then, figure out how to make your servlet and JSP create the desired markup.



Well, in fact this is for what I was searching some help... OK, I'll try to figure out by myself, thank you anyway...

Regarding Growl, thanks for the info, I'll try to find out more about it.
8 years ago
JSP
Thanks for your answer.

What I'd like to show is a message coming from the servlet, for a first approach it could be valid text on the JSP page. I don't know what you mean by a modern "growl-style" notification, but it sounds good:).

I know it must be done through HTML and CSS code but this is what I want to find out. Could someone please provide a small example?

Thanks again.

Regards.
8 years ago
JSP
Dear colleagues,

Could you please advise what you think is the best way of sending an error message from a servlet for a later presentation in a JSP page? I mean the equivalent of a JavaScript alert message.

I tried to do it by using the JOptionPane class, but I discarded as the message is shown only in the server...

Thank you all in advance.

Kind regards.

8 years ago
JSP