Win a copy of Head First Android this week in the Android forum!

Peter Bergoff

Ranch Hand
+ Follow
since Apr 07, 2004
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 Peter Bergoff

Thanks Bear! I am familiar with mapping to shorten and change servlet names. Is there a way to take this a step further and use the mapping to avoid placing parameters in the URL when calling that servlet?
Something like:
http://www.homes.com/styles-brick
instead of
http://www.homes.com/styles?type=brick

Basically I want to make my URLs pretty without having to create a new servlet for each page. I suppose in theory I could create a unique servlet for each variation but it would be nice to avoid that. Is there a standard for this type of thing?

Thanks!
9 years ago
JSP
Hi everyone,

I'm wondering how I can do wordpress type permalinks in Java (or specifically JSP). For example:
http://www.homes.com/styles.jsp?type=brick
to
http://www.homes.com/brick
or
http://www.homes.com/styles/brick (where styles signals which JSP needs to be called)
or something like that to avoid the parameters.

Ideally this would be dynamic so I wouldn't have to set up individual permalinks for each page.

Thanks!

9 years ago
JSP
Hi everyone,

I have a legacy website built with sevlets and JSP. I keep hearing how wordpress is the way to go but hate to give up all the work I've done building my Java based site. As far as I can tell my only choice is to basically have my site contain 2 separate code bases and switch between them depending on the page the user wants. In my java site users log in so I'd have to figure out a way to share sessions. Anyone run into this?

Applogies if this is the incorrect forum to discuss this topic.

Thanks.
9 years ago
Bear and Tim - You guys rock. Thanks.
9 years ago
Hi,

I am writing servlets with text in them. Every time I have a comma, apostrophe, ampersand or similar characters I have to use the html special characters. Is there some easier way to do this other than me manually searching for the character and replacing with the html code equivalent? If I don't convert the characters an ampersand becomes a question mark ect . ..

Thanks!
9 years ago
Hi everyone,

I believe I have a problem with my web hosting company's mail server.

When I test my website from my development box (my PC) using my ISP's outgoing mail server I am able to successfully send an e-mail into a user's inbox in Yahoo. However, when I then migrate that code to my hosting company's server and use their e-mail server the e-mails go into Yahoo's spam folder. As far as I can tell both implementations are the same except they differ in use of the mail server.

The other differenec is that my hosting service requires that I use authenticated outgoing mail.

Both have the same e-mail sender so I don't think it's a DNS spam filter. Also my web site is brand new and hasn't had a chance to do bad things yet.

My hosting company assures me they are able to send e-mails from that server to use's Yahoo inbox. So I'm at a loss.

Any thoughts?

Thanks,

Peter
13 years ago
Got it!

<servlet>
<servlet-name>UserSignIn</servlet-name>
<servlet-class>mlo.UserSignIn</servlet-class>
</servlet>

<servlet-mapping>
<servlet-name>UserSignIn</servlet-name>
<url-pattern>/servlet/mlo.UserSignIn</url-pattern>
</servlet-mapping>
13 years ago
No, it didn't work.

I was trying a lot of different things and tried this:

<servlet>
<servlet-name>mlo.UserSignIn</servlet-name>
<servlet-class>mlo.UserSignIn</servlet-class>
</servlet>

<servlet-mapping>
<servlet-name>mlo.UserSignIn</servlet-name>
<url-pattern>/servlet/*</url-pattern>
</servlet-mapping>

It mapped everything to the UserSignIn servlet.

I don't get it. Can anyone show me how this should work?
[ May 30, 2008: Message edited by: Peter Bergoff ]
13 years ago
Okay, so here's what I understand:

To run this servlet:

http://www.xxxx.com/mlo/servlet/mlo.UserSignIn

I need this mapping in my web.xml:

<servlet>
<servlet-name>mlo.UserSignIn</servlet-name>
<servlet-class>mlo.UserSignIn</servlet-class>
</servlet>

<servlet-mapping>
<servlet-name>mlo.UserSignIn</servlet-name>
<url-pattern>/servlet/mlo.UserSignIn</url-pattern>
</servlet-mapping>
13 years ago
Ah, so from some quick reading on this topic I would guess I need to add the following to my web.xml to get the servlet to work:

<servlet-mapping>
<servlet-name>mlo.UserSignIn</servlet-name>
<url-pattern>mlo.UserSignIn</url-pattern>
</servlet-mapping>

I'm sure this is defeating the security reasons it should be used but just trying to get a basic idea of what's going on. Does that look right?
13 years ago
Hi everyone,

I'm sure this is an easy one but can't figure it out . . .

I have a servlet which can't be found by tomcat. Following is my setup:

servlet class is in WEB-INF/classes/mlo

I am attempting to request as follows:
http://www.xxxx.com/mlo/servlet/mlo.UserSignIn

I have the follwoing in my web.xml:
<servlet>
<servlet-name>mlo.UserSignIn</servlet-name>
<servlet-class>mlo.UserSignIn</servlet-class>
</servlet>

Anything look funny?

Thanks,

Peter
13 years ago
I deleted and reloaded my classes and it did find them. I didn't change anything but now it did work. Weird stuff. Thanks Bear.
Thanks Bear!

Yeah, that is weird to see an eclipse type message. I have seen error messages due to jdk version mismatch between the eclipse used to compile vs. the tomcat app server's jdk. I developed using jdk 1.6.0_04 while the virtual app server only goes up to jdk 1.6.0_03, which is what it's currently set to.
[ May 28, 2008: Message edited by: Peter Bergoff ]
Hi Bear,

Per your request, case updated. : )

The files are placed in WEB-INF/classes/mlo.
Hi Bear,

I did not use a war or jar file. I have loaded the files directly into the context using the standard directory structure. That's how I've done it on my computer as well and it's worked.

Thanks for your help!