Murat Balkan

Ranch Hand
+ Follow
since Sep 10, 2002
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 Murat Balkan

Hi,
Thanks for the reply.
I was able to reach the webapps real path via:

File dir = new File(request.getServletContext().getRealPath("/"));
System.out.println(dir.getParent());

Regards,
Murat
11 years ago
Hi
can you give an example to the first one?
I want to find the path to the webapps directory.
Regards,
Murat
11 years ago
Hi,
I want to get that physical path dynamically so that if the path changes, i should not update the code.
Thanks,
Murat
11 years ago
Hi there,

I want to upload images to a directory that is outside of the current context, the same folder with the .WAR file. This way, when the WAR is updated, the images will remain on the server.
How can I reach the path to the parent directory of the context?

Thanks for your help,
Murat
11 years ago
Hi,
Thanks for the answer.
So I should ask the question as when is the ObjectStack reset? I guess this within the request scope. In the second call of the same action, the previous results will not be available.
Am I right?

Thanks,

12 years ago
Hi all,

I have a quick question regarding the ValueStack in S2. Does it have the Request scope or Session scope? If I put an object to the valuestack what will be its' lifetime?

Regards,
Murat
12 years ago
Hi,
I am using struts validation and everytime a validation error occurs within the form, the error message is displayed on the top of the field.
Is it possible to show it in another location. (for exampl right of the field?)
Regards,
12 years ago
Hi all,

I have a very simple form like this:

<s:form action="login" method="post">
<s:textfield name="username" label="Username" size="20" />
<s:password name="password" label="Password" size="20" />
<s:submit label="Enter Site" align="center" method="execute" />
</s:form>

My problem is I cannot change the label of the submit button. It always displays the string "Submit"?

Do you have any idea why this is happening?

Regards,
Murat
12 years ago
Hi,
it is not JPA or EJB. It is implemented as POJO.
Thanks,
Hi,
I am working on an application where I have 2 DAOs:
CustomerDAO and SubscriptionDAO. I am using pure JDBC within those daos. A manager SLSB creates and call CRUD methods on these DAOs.
In the scenario, whenever a new Customer is created, I need to create a Subscription automatically. (giving the customer id to the subscription)
I do this like this:

...
int id=customerdao.insert(customerVO);
...
subscriptionVO.customerid=id;
subscriptionDAO.insert(subscriptionvo);

I wonder how can I include transactional capabilities to this code. (If I use Tomcat alone, or Tomcat with an AS I havent decided yet).
That is to say, if theres a problem in the subscription insert section, customerdao.insert should be rollbacked.

Thank you for your help,
Murat
I removed the annotation from the filter and added a web.xml file to the project. I made the necessary changes in web.xml:

<filter>
<filter-name>Filtre1</filter-name>
<filter-class>filtreler.Filtre1</filter-class>
</filter>
<filter-mapping>
<filter-name>Filtre1</filter-name>
<servlet-name>TestServlet</servlet-name>
</filter-mapping>

And it does not work again. TestServlet runs but filter is not triggered. I can see that the init method of the filter runs, so it is loaded by the container.

Right after that, I tried changing the above code with this:

<filter>
<filter-name>Filtre1</filter-name>
<filter-class>filtreler.Filtre1</filter-class>
</filter>
<filter-mapping>
<filter-name>Filtre1</filter-name>
<url-pattern>/TestServlet</url-pattern>
</filter-mapping>

And it works! So it is not about the annotations or web.xml file. It seems Tomcat ignores the <servlet-name> usage.

Any thoughts? Could this be a bug? Has someone test the same on Tomcat 7?

Thanks a lot,

Murat

12 years ago
Hi all,

I have a problem with a filter deployment. I have a very simple filter that just outputs a message to the console via a System.out.println call.
To test the filter, I created a simple Servlet named TestServlet which actually does nothing in its doGet. TestServlet has been deployed on servlet path /TestServlet under the webcontent (MyProject)
I confirm that I can call the servlet via http://localhost:8080/MyProject/TestServlet without any problems.

My problem is, when I specify the servlet name in WebFilter annotation, tomcat seems to ignore it. (ServletFilter is not triggered.)

@WebFilter(servletNames = { "TestServlet" })
public class TestFiltre implements Filter {}

But when I use urlPatterns attribute, The filter works fine.

@WebFilter(urlPatterns = { "/TestServlet" })


Does Tomcat support servletNames in Filters? Or I have a configuration problem?

Thanks a lot,

Murat
12 years ago
Hi,

I am working on a composite object which have 2 sub levels underneath. I mean for example, Customer-CustomerAccount-CustomeAccountDetail.
I'd like to add additional CustomerAccountDetails to the Customer.

How can I show this in a sequence diagram?

In Cade's 2nd edition book, all the examples are for the first level objects where he just new()s the objec and persist. Does this represantation also work for composites?


I appreciate your help

Regards,
Murat
Hi all,
I am not sure whether to add an additional login/logout use case as a prerequisite to the other use cases.
How do you design this part? Do you require the user to log in to the system before start designing his house?
Thanks a lot,
Murat
Thanks for your answers. I fully aggree with you.
But I am considering to use Entity beans which directly corresponds to tables. (Am I wrong?)
Ofcourse,my high level class diagram will not include those entities but I was wondering how will it look like in a detailed class diagram.
Thanks again,
Murat